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

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 31st May 2012, 22:07
onastvar onastvar is offline
Senior Member
 
Join Date: Apr 2008
Location: U.S.A.
Posts: 188
Thanks: 59
Thanked 10 Times in 10 Posts
Default nginx and wordpress permalink settings

I've added the following to nginx Directives for mysite

Code:
location / {
                try_files $uri $uri/ /index.php?$args;
       }
Any wordpress permalink settings besides default I get error
"ERROR 404 - Not Found!"

I followed The Perfect Server - Debian Squeeze (Debian 6.0) With BIND, Dovecot & Nginx [ISPConfig 3] to setup my server
The Perfect Server - Debian Squeeze (Debian 6.0) With BIND, Dovecot & Nginx [ISPConfig 3]

Permalink Settings (Settings > Permalinks) structure is

/%year%/%monthnum%/%day%/%postname%/

My vhost file looks like this:

Code:
server {
        listen *:80;


        server_name example.com www.example.com;

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



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



        error_page 400 /error/400.html;
        error_page 401 /error/401.html;
        error_page 403 /error/403.html;
        error_page 404 /error/404.html;
        error_page 405 /error/405.html;
        error_page 500 /error/500.html;
        error_page 502 /error/502.html;
        error_page 503 /error/503.html;
        recursive_error_pages on;
        location = /error/400.html {
            internal;
        }
        location = /error/401.html {
            internal;
        }
        location = /error/403.html {
            internal;
        }
        location = /error/404.html {
            internal;
        }
        location = /error/405.html {
            internal;
        }
        location = /error/500.html {
            internal;
        }
        location = /error/502.html {
            internal;
        }
        location = /error/503.html {
            internal;
        }

        error_log /var/log/ispconfig/httpd/example.com/error.log;
        access_log /var/log/ispconfig/httpd/example.com/access.log combined;


        ## 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/client0/web1/.htpasswd_stats;
        }

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

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


		
}
Any ideas how to make nginx work with wordpress?

Thanks!
__________________
ISPConfig 3.0.5.4p1 | Debian Wheezy | BIND | Dovecot 1.2.15 | Apache 2.2.16 | MySQL 5.5 | PHP 5.4.4-14
Reply With Quote
Sponsored Links
  #2  
Old 31st May 2012, 23:44
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

I have this in my nginx Directives field:
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
The Following User Says Thank You to falko For This Useful Post:
onastvar (1st June 2012)
  #3  
Old 1st June 2012, 17:48
onastvar onastvar is offline
Senior Member
 
Join Date: Apr 2008
Location: U.S.A.
Posts: 188
Thanks: 59
Thanked 10 Times in 10 Posts
Default

Thanks Falko, that worked!

Do you know how long it takes ISPConfig to process the
change I make in DNS, nginx directives, etc?
__________________
ISPConfig 3.0.5.4p1 | Debian Wheezy | BIND | Dovecot 1.2.15 | Apache 2.2.16 | MySQL 5.5 | PHP 5.4.4-14
Reply With Quote
The Following User Says Thank You to onastvar For This Useful Post:
cnaqqrvk (16th November 2012)
  #4  
Old 2nd June 2012, 11:18
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

The backend processes changes once per minute.
__________________
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
The Following User Says Thank You to falko For This Useful Post:
cnaqqrvk (16th November 2012)
  #5  
Old 4th July 2012, 08:43
onastvar onastvar is offline
Senior Member
 
Join Date: Apr 2008
Location: U.S.A.
Posts: 188
Thanks: 59
Thanked 10 Times in 10 Posts
Question

I'm using following nginx directives for one web site (i.e. http://domain1.com/) which is WordPress

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;
       }
Anyone knows, how can I make another wordpress site works under the same domain, just another folder
(i.e. http://domain1.com/test/site1) ?

Thanks!!!
__________________
ISPConfig 3.0.5.4p1 | Debian Wheezy | BIND | Dovecot 1.2.15 | Apache 2.2.16 | MySQL 5.5 | PHP 5.4.4-14
Reply With Quote
  #6  
Old 12th November 2012, 06:27
onastvar onastvar is offline
Senior Member
 
Join Date: Apr 2008
Location: U.S.A.
Posts: 188
Thanks: 59
Thanked 10 Times in 10 Posts
Default

Anyone knows, how can I make another wordpress site works under the same domain, just another folder

(i.e. http://domain1.com/test/site1) ?
__________________
ISPConfig 3.0.5.4p1 | Debian Wheezy | BIND | Dovecot 1.2.15 | Apache 2.2.16 | MySQL 5.5 | PHP 5.4.4-14
Reply With Quote
  #7  
Old 12th November 2012, 13:16
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Try

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

       # Add trailing slash to */wp-admin requests.
       rewrite /test/site1/wp-admin$ $scheme://$host$uri/ permanent;
__________________
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
The Following User Says Thank You to falko For This Useful Post:
onastvar (13th November 2012)
  #8  
Old 13th November 2012, 20:01
onastvar onastvar is offline
Senior Member
 
Join Date: Apr 2008
Location: U.S.A.
Posts: 188
Thanks: 59
Thanked 10 Times in 10 Posts
Default

Thank You Falko! This worked perfectly.
__________________
ISPConfig 3.0.5.4p1 | Debian Wheezy | BIND | Dovecot 1.2.15 | Apache 2.2.16 | MySQL 5.5 | PHP 5.4.4-14
Reply With Quote
  #9  
Old 7th January 2013, 16:50
Ovidiu Ovidiu is offline
Senior Member
 
Join Date: Sep 2005
Posts: 1,262
Thanks: 78
Thanked 24 Times in 20 Posts
 
Default

Quote:
Originally Posted by falko View Post
I have this in my nginx Directives field:
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;
       }
Thanks Falko, that worked perfectly except for one minor annoyance:

if I visit my backend I mysite.tld/wp-admin/index.php the drop-down/hover menus in the backend menu don't work.
If I visit mysite.tld/wp-admin/ everything works perfectly. can we somehow strip the index.php from dashboard URLs?
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
Wordpress Multisite get an 502 cyprus Installation/Configuration 23 6th November 2013 22:18
Wordpress Error 500 on ISPConfig3.0.4.3 NGINX tested0002 Installation/Configuration 15 9th November 2012 12:17
nginx + PHP5-FPM: eventual 500 errors for single site 37minutes Server Operation 1 29th March 2012 15:21
Wordpress admin on nginx+php5-fpm on VPS incredibly slow. Other apps/WP front end OK talkingnews General 6 28th January 2012 12:46
NGINX vs Apache rafael-ec General 1 13th January 2012 08:53


All times are GMT +2. The time now is 18:33.


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