Skip to content

Instantly share code, notes, and snippets.

@hedleygois
Created October 20, 2020 19:22
Show Gist options
  • Save hedleygois/156e96dad75e2d299886100c6c5d39cc to your computer and use it in GitHub Desktop.
Save hedleygois/156e96dad75e2d299886100c6c5d39cc to your computer and use it in GitHub Desktop.
upstream hedley {
server 127.0.0.1:3000;
keepalive 32;
}
server {
listen 8080;
listen [::]:8080;
server_name hedley;
#access_log /usr/local/etc/nginx/logs/example.access.log;
#error_log /usr/local/etc/nginx/logs/example.error.log debug;
location /planner/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarder-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
rewrite ^/planner/(.*)$ http://hedley:8081/$1 redirect;
#proxy_pass http://samantha;
#rewrite ^/(.*)$ http://samantha:8081/$1 redirect;
#proxy_redirect htttp://localhost:3000/ http://samantha:3001/;
}
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarder-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://localhost:3000/;
#proxy_redirect off;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment