Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > ISPConfig 3 Priority Support

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #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
  #2  
Old 3rd June 2013, 16:19
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

Please try this configuration in the nginx Directives field instead:

Code:
location / {
                try_files $uri $uri/ /index.php?$args;
}

# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;

location ~*  \.(jpg|jpeg|png|gif|css|js|ico)$ {
                expires max;
                log_not_found off;
}
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 4th June 2013, 16:49
cafeine65 cafeine65 is offline
Junior Member
 
Join Date: May 2013
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

thanks a lot. it's fine now. I put code on Directive Snippets for a future use.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem Updating and Uploading to Wordpress website on ISPConfig3 - Fedora 13 MrCompTech Tips/Tricks/Mods 7 7th January 2014 01:07
ISPConfig web stats and Wordpress arkkimus Installation/Configuration 1 21st December 2012 08:28
Wordpress Error 500 on ISPConfig3.0.4.3 NGINX tested0002 Installation/Configuration 15 9th November 2012 12:17
Wordpress, not access to /stats/ directory ErikZ Installation/Configuration 11 4th May 2012 23:05
ISPConfig 3.x - First Steps (Creating Web Sites, Email Addresses, Etc.) sighkick Suggest HOWTO 18 7th October 2010 00:12


All times are GMT +2. The time now is 10:11.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.