Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80 default_server;
- root /var/www/html;
- index index.html index.htm;
- location /api {
- proxy_redirect http://localhost:3001/ /api;
- proxy_pass_header Server;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Scheme $scheme;
- proxy_set_header Host $http_host;
- proxy_set_header X-NginX-Proxy true;
- proxy_connect_timeout 5;
- proxy_read_timeout 240;
- proxy_intercept_errors on;
- proxy_pass http://127.0.0.1:3001;
- }
- location /graphql {
- proxy_redirect http://localhost:3001/ /graphql;
- proxy_pass_header Server;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Scheme $scheme;
- proxy_set_header Host $http_host;
- proxy_set_header X-NginX-Proxy true;
- proxy_connect_timeout 5;
- proxy_read_timeout 240;
- proxy_intercept_errors on;
- proxy_pass http://127.0.0.1:3001;
- }
- location ~* .(?:manifest|appcache|html?|xml|json)$ {
- expires -1;
- # access_log logs/static.log; # I don't usually include a static log
- }
- location ~* .(?:css|js)$ {
- try_files $uri =404;
- expires 1y;
- access_log off;
- add_header Cache-Control "public";
- }
- # Any route containing a file extension (e.g. /devicesfile.js)
- location ~ ^.+..+$ {
- try_files $uri =404;
- }
- # Any route that doesn't have a file extension (e.g. /devices)
- location / {
- try_files $uri $uri/ /index.html;
- }
- }
Add Comment
Please, Sign In to add comment