View Single Post
  #1  
Old 3rd June 2013, 14:43
cafeine65 cafeine65 is offline
Junior Member
 
Join Date: May 2013
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Nginx / protect directory and Wordpress

Hi,

I have some problems with nginx and wordpress and protect directory

I have a wordpress site with permalink active :
Code:
www.mywebsite.com/index.php/%year%/%monthnum%/%day%/%postname%/
I have a nginx and in ISP Config web site I add :
Code:
try_files $uri $uri/ /index.php?q=$uri&$args;
It's work fine

When I add a protect folder on / (base of my web site), I have a 404 not found

here the code of the vhost
Code:
server {
        listen *:80;


        server_name mywebsite.com ;

        root   /var/www/mywebsite.com/web;



        index index.html index.htm index.php index.cgi index.pl index.xhtml;



        error_log /var/log/ispconfig/httpd/mywebsite.com/error.log;
        access_log /var/log/ispconfig/httpd/mywebsite.com/access.log combin$

        ## Disable .htaccess and other hidden files
        location ~ /\. {
            deny all;
            access_log off;
            log_not_found off;
        }

        location = /favicon.ico {
            log_not_found off;
            access_log off;
        }

        location = /robots.txt {
            allow all;
            log_not_found off;
            access_log off;
        }

        location /stats {

            index index.html index.php;
            auth_basic "Members Only";
            auth_basic_user_file /var/www/clients/client1/web1/web/stats/.htpas$
        }

        location ^~ /awstats-icon {
            alias /usr/share/awstats/icon;
        }

        location ~ \.php$ {
            try_files /4e59b599d97e7f99c0a520473a78ad7.htm @php;
        }

        location @php {
            try_files $uri =404;
            include /etc/nginx/fastcgi_params;
            fastcgi_pass 127.0.0.1:9036;
            include /etc/nginx/fastcgi_params;
            fastcgi_pass 127.0.0.1:9036;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            #fastcgi_param PATH_INFO $fastcgi_script_name;
            fastcgi_intercept_errors on;
        }


        try_files $uri $uri/ /index.php?q=$uri&$args;

        location / {
                auth_basic "Members Only";
                auth_basic_user_file /var/www/clients/client1/web1/web/.htpassw$

                location ~ \.php$ {
                    try_files /4e59b599d97e7f99c0a520473a78ad7.htm @php;
                }
        }

}

Have you a fix or an idea ?

Thanks in advance
Reply With Quote
Sponsored Links