Skip to content

Instantly share code, notes, and snippets.

@tieppt
Created June 2, 2020 05:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tieppt/c9f0dd90467f66f77c4530bd541c49d4 to your computer and use it in GitHub Desktop.
Save tieppt/c9f0dd90467f66f77c4530bd541c49d4 to your computer and use it in GitHub Desktop.
Angular Nginx Conf
server {
## port
listen 80;
## Your website name goes here.
server_name example.com;
## Your only path reference.
root /var/www/example.com/public_html;
## This should be in your http block and if it is, it's not needed here.
index index.html;
autoindex off;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.html break;
}
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment