Hi,
settings: CB2+Nginx+PHP-FPM
In my server I have several Wordpress instalations and I want to use permalink as I was using with apache. so I edited the file /usr/local/directadmin/data/templates/nginx_server.conf to add this location:
All went OK until I added a protected directory and I choosed the public_html directory, so in the nginx.conf I had 2 locations with the root, and it raised an error.
The new code in nginx is:
How I could add the location "/" to a custom nginx_server.conf and doesn't crash with the nginx_protected_directory.conf
settings: CB2+Nginx+PHP-FPM
In my server I have several Wordpress instalations and I want to use permalink as I was using with apache. so I edited the file /usr/local/directadmin/data/templates/nginx_server.conf to add this location:
Code:
location / {
# This is cool because no php is touched for static content.
# include the "?$args" part so non-default permalinks doesn't break when using query string
#http://wiki.nginx.org/Wordpress
try_files $uri $uri/ /index.php?$args;
}
All went OK until I added a protected directory and I choosed the public_html directory, so in the nginx.conf I had 2 locations with the root, and it raised an error.
The new code in nginx is:
Code:
location / {
# This is cool because no php is touched for static content.
# include the "?$args" part so non-default permalinks doesn't break when using query string
# http://wiki.nginx.org/Wordpress
try_files $uri $uri/ /index.php?$args;
}
# use fastcgi for all php files
location ~ \.php$
{
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/nginx_limits.conf;
if (-f $request_filename)
{
fastcgi_pass unix:/usr/local/php55/sockets/exampledomain.sock;
}
}
location / {
auth_basic "members";
auth_basic_user_file /home/admin/domains/exampledomain.com/.htpasswd/public_html/.htpasswd;
}
How I could add the location "/" to a custom nginx_server.conf and doesn't crash with the nginx_protected_directory.conf