Created
June 2, 2020 05:22
-
-
Save tieppt/c9f0dd90467f66f77c4530bd541c49d4 to your computer and use it in GitHub Desktop.
Angular Nginx Conf
This file contains hidden or 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 { | |
## 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