Last active
May 18, 2019 07:00
-
-
Save roman01la/06f0cfef2b53ff609f89 to your computer and use it in GitHub Desktop.
Node.js Express Nginx
This file contains hidden or 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
server { | |
listen 80; | |
server_name example.com; | |
location / { | |
proxy_pass http://127.0.0.1:3000; | |
} | |
location ~ ^/(images/|scripts/|styles/|robots.txt|humans.txt|favicon.ico) { | |
root /your/app/public/folder; | |
access_log off; | |
expires max; | |
} | |
} |
This file contains hidden or 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
/* Turn off Express static middleware, get rid of this line */ | |
server.use(express.static(path.join(__dirname, 'public'))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment