Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80 default_server;
- listen [::]:80 default_server;
- server_name example.com;
- root /var/www/html/;
- index index.php;
- error_log /var/log/nginx/error.log;
- access_log /var/log/nginx/access.log;
- location / {
- try_files $uri $uri/ /index.php?$query_string;
- }
- location ~ .php$ {
- include fastcgi_params;
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_intercept_errors on;
- fastcgi_index app.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_read_timeout 600;
- }
- error_page 404 /error/404.html;
- error_page 500 502 503 504 /error/50x.html;
- location ^~ /error/ {
- root /usr/share/nginx/html/;
- }
- }
- location /api/ {
- }
- location /api {
- error_page 499 error.html
- }
- location /api {
- try_files $uri $uri/ /path/to/api/handler;
- }
- server {
- include /etc/nginx/boilerplate/fancyerror_and_intercept.conf;
- location ~ (?<target>.*) {
- proxy_pass http://$backend;
- }
- }
- error_page 404 /40x.html;
- error_page 403 /40x.html;
- error_page 405 /40x.html;
- error_page 500 /50x.html;
- error_page 501 /50x.html;
- error_page 502 /50x.html;
- error_page 503 /50x.html;
- location = /40x.html {
- root /etc/nginx/error_pages;
- }
- location = /50x.html {
- root /etc/nginx/error_pages;
- }
- more_set_headers -s '404 403 405 500 501 502 503 504' 'X-Robots-Tag: noindex, nofollow';
- proxy_intercept_errors on;
- location ~ ^/api/ {
- error_page 527 error.html;
- proxy_intercept_errors off;
- proxy_pass http://$backend;
- }
Add Comment
Please, Sign In to add comment