Last active
September 20, 2022 04:30
-
-
Save mailtodanish/b7cbf41de63e7d8510e4070ac15a1017 to your computer and use it in GitHub Desktop.
Nginx config for React
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 { | |
server_name danishwebs.co.in www.danishwebs.co.in; | |
access_log /var/log/nginx/danishwebs-access.log; | |
error_log /var/log/nginx/danishwebs-error.log; | |
root /var/www/react/html; | |
location / { | |
try_files $uri /index.html; | |
} | |
} | |
server { | |
if ($host = danishwebs.co.in) { | |
return 301 https://$host$request_uri; | |
} # managed by Certbot | |
listen 80 ; | |
server_name danishwebs.co.in www.danishwebs.co.in; | |
return 404; # managed by Certbot | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment