diff --git a/conf/nginx.conf b/conf/nginx.conf index 045afd5..2b82a91 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -9,6 +9,9 @@ location __PATHTOCHANGE__ { if (!-e $request_filename) { + rewrite ^/([^/]*)/robots\.txt$ __PATHTOCHANGE__/spip.php?page=robots.txt last; + rewrite ^/([^/]*)/favicon\.ico$ __PATHTOCHANGE__/spip.php?page=favicon.ico last; + rewrite ^/([^/]*)/sitemap\.xml$ __PATHTOCHANGE__/spip.php?page=sitemap.xml last; rewrite ^(.+)$ __PATHTOCHANGE__/index.php?q=$1 last; } if ($scheme = http) { @@ -25,8 +28,8 @@ location __PATHTOCHANGE__ { add_header X-Download-Options noopen; add_header X-Permitted-Cross-Domain-Policies none; - location ~^/(tmp|config)/{ - return 403; + location ~^/(tmp|config|\.ht)/{ + deny all; } location ~* \.(jpg|jpeg|gif|css|png|js|ico|swf|mp3|pdf)$ { # Le contenu statique, est signalé au navigateur comme étant @@ -36,19 +39,6 @@ location __PATHTOCHANGE__ { expires 1w; add_header Cache-Control public; } - #location ~ ^/__NAMETOCHANGE__ { - # La configuration globale du site. Tout ce qui ne va dans - # aucune autre location vas ici. - - # Quelques fichiers standards générés par spip et devant être - # à des URL précises. - # rewrite ^/([^/]*)/robots\.txt$ /spip.php?page=robots.txt last; - # rewrite ^/([^/]*)/favicon\.ico$ /spip.php?page=favicon.ico last; - # rewrite ^/([^/]*)/sitemap\.xml$ /spip.php?page=sitemap.xml last; - # rewrite ^/([^/]*)/mobile\.html$ /spip.php?page=mobile_uk last; - - # try_files $uri $uri/ /spip.php?q=$uri&$args; - #} location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/var/run/php5-fpm-__NAMETOCHANGE__.sock; diff --git a/scripts/install b/scripts/install index 26aabdc..9a0f7ca 100644 --- a/scripts/install +++ b/scripts/install @@ -62,6 +62,11 @@ sudo sed -i "s@__PATHTOCHANGE__@$path@g" /etc/nginx/conf.d/$domain.d/$app.conf sudo sed -i "s@__FINALPATH__@$final_path@g" /etc/nginx/conf.d/$domain.d/$app.conf sudo sed -i "s@__NAMETOCHANGE__@$app@g" /etc/nginx/conf.d/$domain.d/$app.conf +if [ "$is_public" = "Yes" ]; +then + sudo sed -i "s@#--PRIVATE--@@g" /etc/nginx/conf.d/$domain.d/$app.conf +fi + POOL_FPM sudo cp ../conf/connect.php $final_path/config/connect.php