1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/spip_ynh.git synced 2024-09-03 20:25:59 +02:00

ajou des rewrite dans la conf nginx

This commit is contained in:
magikcypress 2017-02-23 23:52:18 +01:00
parent eb6f771a71
commit d873ab230f
2 changed files with 10 additions and 15 deletions

View file

@ -9,6 +9,9 @@ location __PATHTOCHANGE__ {
if (!-e $request_filename) 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; rewrite ^(.+)$ __PATHTOCHANGE__/index.php?q=$1 last;
} }
if ($scheme = http) { if ($scheme = http) {
@ -25,8 +28,8 @@ location __PATHTOCHANGE__ {
add_header X-Download-Options noopen; add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none; add_header X-Permitted-Cross-Domain-Policies none;
location ~^/(tmp|config)/{ location ~^/(tmp|config|\.ht)/{
return 403; deny all;
} }
location ~* \.(jpg|jpeg|gif|css|png|js|ico|swf|mp3|pdf)$ { location ~* \.(jpg|jpeg|gif|css|png|js|ico|swf|mp3|pdf)$ {
# Le contenu statique, est signalé au navigateur comme étant # Le contenu statique, est signalé au navigateur comme étant
@ -36,19 +39,6 @@ location __PATHTOCHANGE__ {
expires 1w; expires 1w;
add_header Cache-Control public; 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(/|$) { location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php5-fpm-__NAMETOCHANGE__.sock; fastcgi_pass unix:/var/run/php5-fpm-__NAMETOCHANGE__.sock;

View file

@ -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@__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 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 POOL_FPM
sudo cp ../conf/connect.php $final_path/config/connect.php sudo cp ../conf/connect.php $final_path/config/connect.php