Skip to content

Instantly share code, notes, and snippets.

@martwozniak
Created May 1, 2022 18:57
Show Gist options
  • Save martwozniak/c9e813936cf35d403cc72cfc033b0d03 to your computer and use it in GitHub Desktop.
Save martwozniak/c9e813936cf35d403cc72cfc033b0d03 to your computer and use it in GitHub Desktop.
nginx reverse proxy without ssl
server {
server_name <DOMAIN_NAME> www.<DOMAIN_NAME>;
client_max_body_size 100M;
autoindex off;
location / {
# reverse proxy for next server
proxy_pass http://localhost:<PORT>;
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;
# we need to remove this 404 handling
# because next's _next folder and own handling
# try_files $uri $uri/ =404;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment