Created
July 22, 2018 13:43
-
-
Save Rocketeer007/13897dee2b7001bf879957d97c9ec3cc to your computer and use it in GitHub Desktop.
nginx configuration for create-react-app with backend proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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