Last active
October 1, 2018 06:38
-
-
Save zdwolfe/6721115 to your computer and use it in GitHub Desktop.
Basic nginx configuration for AngularJS html5Mode
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 0.0.0.0:12345; | |
location / { | |
root /home/zdwolfe/src/angularAWS/app; | |
try_files $uri $uri/ /index.html =404; | |
} | |
} |
This gist has little more details
https://gist.github.com/shreyas-satish/8452999
This worked for me.
https://gist.github.com/cjus/b46a243ba610661a7efb
This a dirty solution, but worked for me.
Sacrifice my 404 page, but fix the main problem.
server {
listen 0.0.0.0:12345;
location / {
root /home/zdwolfe/src/angularAWS/app;
try_files $uri $uri/ /index.html =404;
}
error_page 404 /index.html
}
I want ionic web app to run in subfolder
location /con { root /var/www/html/p/ionicsub/www; index index.html index.htm; try_files $uri $uri/ /index.html =404; }
But this didn't work 404 for the js and css
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this does not work well when the angular urls are like this
http://serverpath/a/b
all the css and js files will try to load from http://serverpath/a/