Skip to content

Instantly share code, notes, and snippets.

@LasaleFamine
Created June 21, 2020 21:06
Show Gist options
  • Select an option

  • Save LasaleFamine/9f2febbe5d6f3e17cc51a8b5bec3f00d to your computer and use it in GitHub Desktop.

Select an option

Save LasaleFamine/9f2febbe5d6f3e17cc51a8b5bec3f00d to your computer and use it in GitHub Desktop.
Sample Nginx site config file for Docker-Strapi application
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