nginx and Wordpress

Discussion in 'Installation/Configuration' started by Rashef, Feb 1, 2013.

  1. Rashef

    Rashef New Member

    Hi guys,

    I'm struggling to understand how to have my Wordpress instances working properly on NGINX with a ISPconfig3 head...

    I found many different guides about how to modify NGINX for Wordpress, but I'd like to understand if I can avoid to modify the conf files and use only the ISPconfig3 interface.

    This is my current conf in "nginx Directives":

    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;
           }
    fastcgi_buffers 8 16k;
    fastcgi_buffer_size 32k;
    But I'm still not able to have Wordpress in a subfolder working with the root URL, anyone succeed on it?
     
    Last edited: Feb 1, 2013
  2. falko

    falko Super Moderator ISPConfig Developer

    Set up a new vhost and add a root directive that points to the correct folder:


    Code:
    location / {
           root /path/to/your/document/root;
           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;
           }
    }
     
  3. rlischer

    rlischer Member HowtoForge Supporter

    Are you saying to paste the above code in "nginx Directives" of the site?

    thanks!
     
  4. falko

    falko Super Moderator ISPConfig Developer

    Yes, that's right!
     
  5. rlischer

    rlischer Member HowtoForge Supporter

    Thanks! This worked like a charm.
     

Share This Page