From ad033e20c2b9c2c8fe5678393917d5a463c59b81 Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Mon, 25 Jul 2016 18:33:39 +0200 Subject: Adding nginx example file. See sections under comment #4456 to see how to make PHP handle images requests --- examples/blog/data/nginx.conf | 50 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 examples/blog/data/nginx.conf diff --git a/examples/blog/data/nginx.conf b/examples/blog/data/nginx.conf new file mode 100644 index 00000000..be9e22f9 --- /dev/null +++ b/examples/blog/data/nginx.conf @@ -0,0 +1,50 @@ +server { + listen 80; + listen [::]:80; + + server_name blog; + + ssi on; + root /home/marcello/merchant/examples/blog; + index index.html; + + location / { + try_files $uri $uri/ =404; + rewrite /taler/pay /pay.php; + rewrite /taler/contract /generate_taler_contract.php; + + } + + # #4456 + location ~ ^/data/([^/]+)/([^/]+)\.(jpg|png|gif|jpe?g)$ { + rewrite ^/data/([^/]+)/([^/]+)\.(jpg|png|gif|jpe?g)$ /images.php?article=$1&image=$2.$3; + } + + location ~ \.php$ { + + fastcgi_pass unix:/var/run/php5-fpm.sock; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + } + + location /fullfillment { + + rewrite /(.*) /$1.php; + } + + location /articles { + internal; + } + + # #4456 + location /data { + internal; + } + location /backend { + rewrite /backend/(.*) /$1 break; + proxy_pass http://127.0.0.1:9966; + proxy_redirect off; + proxy_set_header Host $host; + + } +} -- cgit v1.2.3