r***@webworxshop.com
2011-09-17 23:14:04 UTC
Hi All,
I'm trying to migrate all the web apps on my server from Apache to
Nginx. So far I'm quite liking it's clean configuration style and it
seems (subjectively) quicker. However, I'm having problems reproducing a
particular part of my Apache configuration, here is my situation:
I have a virtual host, which I use for my webmail. The document root
points to Roundcube, located at /usr/share/roundcubemail. On the same
host I also want to run postfixadmin, located at /var/www/postfixadmin.
In Apache this would be as simple as:
Alias /postfixadmin /var/www/postfixadmin
Followed by a location block to define permissions, etc.
In Nginx the closest I've been able to get is:
location /postfixadmin {
root /var/www;
try_files $uri $uri/ /postfixadmin/index.php;
}
location ~ ^/postfixadmin/(.+\.php)$ {
root /var/www;
try_files $uri =404;
include fastcgi.conf;
fastcgi_intercept_errors on;
fastcgi_pass php;
}
Which when I visit the URL redirects me to the login page, however none
of the static resources load. Looking at the logs it looks like anything
which is not a PHP script is giving a 404 error. My understanding is
that the first location block should be catching these, but obviously it
isn't.
Can anyone tell me what I'm missing? Also, is there a better way to go
about what I'm trying to do?
Thanks in advance,
Rob
_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
I'm trying to migrate all the web apps on my server from Apache to
Nginx. So far I'm quite liking it's clean configuration style and it
seems (subjectively) quicker. However, I'm having problems reproducing a
particular part of my Apache configuration, here is my situation:
I have a virtual host, which I use for my webmail. The document root
points to Roundcube, located at /usr/share/roundcubemail. On the same
host I also want to run postfixadmin, located at /var/www/postfixadmin.
In Apache this would be as simple as:
Alias /postfixadmin /var/www/postfixadmin
Followed by a location block to define permissions, etc.
In Nginx the closest I've been able to get is:
location /postfixadmin {
root /var/www;
try_files $uri $uri/ /postfixadmin/index.php;
}
location ~ ^/postfixadmin/(.+\.php)$ {
root /var/www;
try_files $uri =404;
include fastcgi.conf;
fastcgi_intercept_errors on;
fastcgi_pass php;
}
Which when I visit the URL redirects me to the login page, however none
of the static resources load. Looking at the logs it looks like anything
which is not a PHP script is giving a 404 error. My understanding is
that the first location block should be catching these, but obviously it
isn't.
Can anyone tell me what I'm missing? Also, is there a better way to go
about what I'm trying to do?
Thanks in advance,
Rob
_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug