123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- server {
- listen 80;
- listen [::]:80;
- server_name $HOST_API;
- return 301 https://$HOST_API${DOLAR}request_uri;
- }
- server {
- listen 443 ssl;
- listen [::]:443;
- server_name $HOST_API;
- ssl_certificate /etc/nginx/certs/fullchain.pem;
- ssl_certificate_key /etc/nginx/certs/privkey.pem;
- root /opt/api/web;
- location /bundles/ {
- root /opt/api/web;
- }
- location / {
- try_files ${DOLAR}uri /index.php${DOLAR}is_args${DOLAR}args;
- }
- # DEV
- location ~ ^/(index_dev)\.php(/|$) {
- fastcgi_pass unix:/tmp/api/api.sock;
- fastcgi_split_path_info ^(.+\.php)(/.*)$;
- include fastcgi_params;
- fastcgi_param SCRIPT_FILENAME ${DOLAR}realpath_root${DOLAR}fastcgi_script_name;
- fastcgi_param DOCUMENT_ROOT ${DOLAR}realpath_root;
- fastcgi_ignore_client_abort on;
- fastcgi_param REMOTE_ADDR ${DOLAR}http_x_real_ip;
- }
- # PROD
- location ~ ^/index\.php(/|$) {
- fastcgi_pass unix:/tmp/api/api.sock;
- fastcgi_split_path_info ^(.+\.php)(/.*)$;
- include fastcgi_params;
- fastcgi_param SCRIPT_FILENAME ${DOLAR}realpath_root${DOLAR}fastcgi_script_name;
- fastcgi_param DOCUMENT_ROOT ${DOLAR}realpath_root;
- fastcgi_ignore_client_abort on;
- fastcgi_param REMOTE_ADDR ${DOLAR}http_x_real_ip;
- internal;
- }
- location ~ \.php$ {
- return 404;
- }
- }
|