Skip to content

Instantly share code, notes, and snippets.

@jhaemin
Last active December 1, 2023 23:49
Show Gist options
  • Save jhaemin/2b659a8570a8d824142cec64803e5943 to your computer and use it in GitHub Desktop.
Save jhaemin/2b659a8570a8d824142cec64803e5943 to your computer and use it in GitHub Desktop.
server {
server_name example.com;
# optional
client_max_body_size 100M;
# remove ending /
# [warn] it may not need for Next.js
# [warn] it may generate an error when establish socket.io connection
# rewrite ^/(.*)/$ /$1 permanent;
location / {
proxy_pass http://localhost:3000;
}
}
server {
server_name www.example.com
return 301 https://example.com$request_uri;
}
# abc.example.com
server {
listen 80;
server_name abc.example.com;
location / {
proxy_pass http://127.0.0.1/abc$request_uri;
proxy_set_header Host example.com;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment