Created
January 19, 2017 07:58
-
-
Save anonymous/9f8c0c8e53b589ae33c63fad575d95a4 to your computer and use it in GitHub Desktop.
ProxyPass dynamic html to Node.js by Apache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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
https://gist.github.com/wuliupo/773613f18155c9f50f9dbf48d18ff5e2