Guest User

Untitled

a guest
Jan 16th, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. server {
  2. listen 80 default_server;
  3. listen [::]:80 default_server;
  4. server_name example.com;
  5. root /var/www/html/;
  6. index index.php;
  7.  
  8. error_log /var/log/nginx/error.log;
  9. access_log /var/log/nginx/access.log;
  10.  
  11. location / {
  12. try_files $uri $uri/ /index.php?$query_string;
  13. }
  14.  
  15. location ~ .php$ {
  16. include fastcgi_params;
  17. fastcgi_pass 127.0.0.1:9000;
  18. fastcgi_intercept_errors on;
  19. fastcgi_index app.php;
  20. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  21. fastcgi_read_timeout 600;
  22. }
  23.  
  24. error_page 404 /error/404.html;
  25. error_page 500 502 503 504 /error/50x.html;
  26. location ^~ /error/ {
  27. root /usr/share/nginx/html/;
  28. }
  29. }
  30.  
  31. location /api/ {
  32. }
  33.  
  34. location /api {
  35. error_page 499 error.html
  36. }
  37.  
  38. location /api {
  39. try_files $uri $uri/ /path/to/api/handler;
  40. }
  41.  
  42. server {
  43.  
  44. include /etc/nginx/boilerplate/fancyerror_and_intercept.conf;
  45.  
  46.  
  47. location ~ (?<target>.*) {
  48. proxy_pass http://$backend;
  49. }
  50.  
  51. }
  52.  
  53. error_page 404 /40x.html;
  54. error_page 403 /40x.html;
  55. error_page 405 /40x.html;
  56. error_page 500 /50x.html;
  57. error_page 501 /50x.html;
  58. error_page 502 /50x.html;
  59. error_page 503 /50x.html;
  60.  
  61.  
  62. location = /40x.html {
  63. root /etc/nginx/error_pages;
  64. }
  65. location = /50x.html {
  66. root /etc/nginx/error_pages;
  67. }
  68.  
  69.  
  70. more_set_headers -s '404 403 405 500 501 502 503 504' 'X-Robots-Tag: noindex, nofollow';
  71. proxy_intercept_errors on;
  72.  
  73. location ~ ^/api/ {
  74. error_page 527 error.html;
  75. proxy_intercept_errors off;
  76. proxy_pass http://$backend;
  77. }
Add Comment
Please, Sign In to add comment