-
Notifications
You must be signed in to change notification settings - Fork 8
Nginx root vs alias
Henryk Paluch edited this page Jul 1, 2016
·
2 revisions
When porting Apache Alias
to Nginx it is very easy to do such mistake:
# Apache: Alias /ks /opt/images
# Nginx: WRONG WAY:
location /ks/ {
root /opt/images/;
}
This is wrong! The URL http://localhost/ks/
is mapped to /opt/images/ks
by Nginx (but in Apache
it maps just to /opt/images
)
The right way is to use Nginx's alias
option:
location /ks/ {
alias /opt/images/;
}
Now it should work as expected by Apache webmasters...
Copyright © Henryk Paluch. All rights reserved.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License