Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80;
- server_name site.com www.site.com;
- root /var/www/site.com;
- access_log /var/log/nginx/domain-site.com-access.log;
- error_log /var/log/nginx/domain-site.com-error.log;
- index index.php index.html;
- rewrite_log on;
- location /api/ {
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- proxy_read_timeout 36000;
- rewrite ^/api/(.*) /$1 break;
- proxy_pass http://site.com:4000;
- proxy_redirect off;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr ;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- }
- location ~* ^/core/ {
- deny all;
- }
- location / {
- if (!-e $request_filename) {
- rewrite ^/(.*)$ /index.php?q=$1 last;
- }
- }
- location ~ \.php$ {
- try_files $uri =404;
- fastcgi_split_path_info ^(.+\.php)(.*)$;
- fastcgi_pass backend-valhalla;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include fastcgi_params;
- fastcgi_ignore_client_abort on;
- fastcgi_param SERVER_NAME $http_host;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement