Skip to content

Instantly share code, notes, and snippets.

@Rocketeer007
Created July 22, 2018 13:43
Show Gist options
  • Save Rocketeer007/13897dee2b7001bf879957d97c9ec3cc to your computer and use it in GitHub Desktop.
Save Rocketeer007/13897dee2b7001bf879957d97c9ec3cc to your computer and use it in GitHub Desktop.
nginx configuration for create-react-app with backend proxy
server {
listen 80;
server_name my-react-app.mydomain.com;
location / {
root /home/user/my-react-app/client/build/;
try_files $uri $uri/ @node_backend;
}
location @node_backend {
send_timeout 120;
proxy_read_timeout 120;
proxy_connect_timeout 120;
proxy_pass http://127.0.0.1:5000;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment