Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. server {
  2. listen 80;
  3. server_name site.com www.site.com;
  4. root /var/www/site.com;
  5. access_log /var/log/nginx/domain-site.com-access.log;
  6. error_log /var/log/nginx/domain-site.com-error.log;
  7. index index.php index.html;
  8. rewrite_log on;
  9.  
  10. location /api/ {
  11. proxy_http_version 1.1;
  12. proxy_set_header Upgrade $http_upgrade;
  13. proxy_set_header Connection "upgrade";
  14. proxy_read_timeout 36000;
  15.  
  16. rewrite ^/api/(.*) /$1 break;
  17. proxy_pass http://site.com:4000;
  18. proxy_redirect off;
  19. proxy_set_header Host $host;
  20.  
  21. proxy_set_header X-Real-IP $remote_addr ;
  22. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  23.  
  24. }
  25.  
  26. location ~* ^/core/ {
  27. deny all;
  28. }
  29.  
  30. location / {
  31. if (!-e $request_filename) {
  32. rewrite ^/(.*)$ /index.php?q=$1 last;
  33. }
  34. }
  35.  
  36.  
  37. location ~ \.php$ {
  38. try_files $uri =404;
  39. fastcgi_split_path_info ^(.+\.php)(.*)$;
  40. fastcgi_pass backend-valhalla;
  41. fastcgi_index index.php;
  42. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  43. include fastcgi_params;
  44. fastcgi_ignore_client_abort on;
  45. fastcgi_param SERVER_NAME $http_host;
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement