ispconfig3+nginx+wordpress+perm urls

Discussion in 'Installation/Configuration' started by AzaraT, Apr 11, 2012.

  1. AzaraT

    AzaraT New Member

    Hi,

    I'm currently having a problem with Wordpress on a CentOS 5.8, ISPConfig3, Nginx with php-fpm setup and getting perm links to work (I've pretty much followed the guide to setting this up on CentOS that is here on the site).

    What happends when I load the website is that I get "No input configured".

    I've done the following steps to make it work:

    1. create a vhost: /etc/nginx/sites-available/www.mysite.com.vhost
    with the following:
    Code:
    server {
           listen 80;
           server_name www.mysite.com mysite.com;
           root /var/www/clients/client1/web1/web;
    
           if ($http_host != "www.mysite.com") {
                     rewrite ^ http://www.mysite.com$request_uri permanent;
           }
    
           index index.php index.html;
    
           location = /favicon.ico {
                    log_not_found off;
                    access_log off;
           }
    
           location = /robots.txt {
                    allow all;
                    log_not_found off;
                    access_log off;
           }
    
           # Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
           location ~ /\. {
                    deny all;
                    access_log off;
                    log_not_found off;
           }
    
           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;
           }
    
           location ~ \.php$ {
                    include /etc/nginx/fastcgi_params;
                    fastcgi_pass 127.0.0.1:9000;
                    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
           }
    }
    2. Created a symlink:
    Code:
    cd /etc/nginx/sites-enabled/
    ln -s /etc/nginx/sites-available/www.mysite.com.vhost www.mysite.com.vhost
    And then reloading nginx (also tried rebooting the whole system).

    When trying to access any site I just get:
    No input configured

    I appreciate any help, thanks!
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Do not create any vhost files manually, instead create a new website in ispconfig. ispconfig takes care on creating all required config files for this site. If you craete a config file manually then this will conflict with the configuration of ispconfig and the site will not work.
     
  3. AzaraT

    AzaraT New Member

    Thanks,

    Should perm urls work out of the box then? Or would further configuration be required, if so, any guide to what?

    Edit: After deleting the vhost and reloading nginx the site wont load at all, I just get "Welcome to Nginx" screen
    edit2: I delete and re-added my website in ISPConfig 3 and the site now loads, however I still get 404s on any permalinks?

    Edit 3: Finally got it working. After readding the website in ISPConfig I went to the vhost configured by ISPConfig 3 for the site and added the following:
    Code:
           location / {
                    try_files $uri $uri/ /index.php?$args;
           }
    
    Which seems to be working :)
     
    Last edited: Apr 12, 2012
    concept21 likes this.
  4. falko

    falko Super Moderator Howtoforge Staff

    Just create a normal web site through ISPConfig and enable PHP. Then go to the options tab and add your additional directives in the nginx Directives field. For example, this is what I use:

    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;
           }
    Also check out this tutorial: http://www.howtoforge.com/running-wordpress-on-nginx-lemp-on-debian-squeeze-ubuntu-11.04
     

Share This Page