Skip to content

Instantly share code, notes, and snippets.

Created January 19, 2017 07:58
Show Gist options
  • Save anonymous/9f8c0c8e53b589ae33c63fad575d95a4 to your computer and use it in GitHub Desktop.
Save anonymous/9f8c0c8e53b589ae33c63fad575d95a4 to your computer and use it in GitHub Desktop.
ProxyPass dynamic html to Node.js by Apache
# Nginx config
# defined in: include vhost/*.conf;
# location: vhost/test-local.conf;
server {
listen 80;
server_name www.test-local.com test-local.com;
root D:\test-local;
index index.html;
if ($http_host !~ "^www.test-local.com$") {
rewrite ^(.*) http://www.test-local.com$1 permanent;
}
location / {
rewrite ^/$ /index.html last;
}
location ~* \.(html?)$ {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment