Skip to content

Instantly share code, notes, and snippets.

@majudhu
Created October 25, 2023 14:46
Show Gist options
  • Save majudhu/6f97f4c52bfd151cd1a57a92f2c2e1cf to your computer and use it in GitHub Desktop.
Save majudhu/6f97f4c52bfd151cd1a57a92f2c2e1cf to your computer and use it in GitHub Desktop.
Remix NGINX config
server {
server_name example.com;
client_max_body_size 100M; # allow huge uploads, upto 100MB
root /home/user/example/public/; # serve static files from public dir with nginx
try_files $uri @remix; # serve static files with nginx, fallback to nextjs on not found
location /build {
add_header Cache-Control "public, max-age=31536000, immutable";
}
location @remix {
include proxy_params;
proxy_pass http://127.0.0.1:3000;
}
location /admin {
include proxy_params;
proxy_pass http://127.0.0.1:3002;
}
location /api {
include proxy_params;
proxy_pass http://127.0.0.1:3002;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment