trichome
Member
I've set up my first LEMP server and have xF running with friendly URLs. Everything seems to be working fine but I'm hoping a seasoned vet can take a look over this virtual host config, especially the commented lines.
First comment is self explanatory.
For the second comment, that line is part of the xF recommended setup but doesn't work along with the try_files directive above it, which I understand is needed for security. Friendly URLs seem to work fine with it commented out though.
Thanks!
First comment is self explanatory.
For the second comment, that line is part of the xF recommended setup but doesn't work along with the try_files directive above it, which I understand is needed for security. Friendly URLs seem to work fine with it commented out though.
Thanks!
Code:
server {
server_name www.example.com example.com;
access_log /srv/www/example.com/logs/access.log;
error_log /srv/www/example.com/logs/error.log;
root /home/user/www/example.com/public_html;
location / {
index index.html index.htm index.php;
}
location /xen/ {
try_files $uri $uri/ /xen/index.php?$uri&$args;
#nginx pitfalls says multiple index directives is bad, but friendly URLs don't work without this
index index.php index.html;
}
location /xen/internal_data/ {
internal;
}
location /xen/library/ {
internal;
}
location ~ \.php$ {
try_files $uri =404;
#try_files $uri /xen/index.php;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}