Multiple sites (blog, wiki, forum) subdirectory, nginx

server {
        listen 80;
        listen [::]:80;

        server_name 5d61057e5e1f.sn.mynetname.net;

        # the base directory for web stuff
        root /var/www;

                # test out the first mount
                location /first {
                        index index.html;
                        try_files $uri $uri/ =404;
                }

                # configuration for wordpress
                location /wp1 {
                        alias /var/www/wp1;
                        index index.php index.html index.htm;

                }

                location ~ \.php$ {
                        fastcgi_split_path_info ^(.+\.php)(/.+)$;
                        fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
                        fastcgi_index index.php;
                        include fastcgi.conf;
                }

}
Giving directions only for wp1:
server {
        listen 80;
        listen [::]:80;

        server_name 5d61057e5e1f.sn.mynetname.net;

        # the base directory for web stuff
        root /var/www;

                # configuration for wordpress
                location /wp1 {
                        alias /var/www/wp1;
                        index index.php index.html index.htm;
                        #try_files $uri $uri/ /index.php?$query_string;
                }
                location ~ /wp1/.+\.php {
                        fastcgi_split_path_info ^(.+\.php)(/.+)$;
                        fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
                        fastcgi_index index.php;
                        include fastcgi.conf;

                }


location /wiki {
alias /var/www/wiki;
index index.php index.html doku.php;
}

location ~ /wiki.*(data|conf|bin|inc)/ {deny all;}
location ~ /wiki.*\.ht {      deny  all;}


location ~ /wiki/.*\.php$ {

        try_files $uri $uri/ /doku.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param REDIRECT_STATUS 200;
        fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
}



}

No comments: