Created
June 21, 2020 21:06
-
-
Save LasaleFamine/9f2febbe5d6f3e17cc51a8b5bec3f00d to your computer and use it in GitHub Desktop.
Sample Nginx site config file for Docker-Strapi application
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
| upstream strapi { | |
| server localhost:1337; | |
| ## For Docker containers and load balancing | |
| # server node2:3000 weight=10 max_fails=3 fail_timeout=30s; | |
| # server node3:3000 weight=10 max_fails=3 fail_timeout=30s; | |
| } | |
| server { | |
| listen 80; | |
| server_name strapi.yourdomain.com; | |
| access_log /var/log/nginx/strapi.yourdomain.com.log; | |
| location / { | |
| proxy_pass http://strapi; | |
| proxy_http_version 1.1; | |
| proxy_set_header Upgrade $http_upgrade; | |
| proxy_set_header Connection 'upgrade'; | |
| proxy_set_header Host $host; | |
| proxy_cache_bypass $http_upgrade; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment