Skip to content

Instantly share code, notes, and snippets.

@mailtodanish
Last active September 20, 2022 04:30
Show Gist options
  • Save mailtodanish/b7cbf41de63e7d8510e4070ac15a1017 to your computer and use it in GitHub Desktop.
Save mailtodanish/b7cbf41de63e7d8510e4070ac15a1017 to your computer and use it in GitHub Desktop.
Nginx config for React
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