Add a special target for the php redirections.

This commit is contained in:
Andrea Dell'Amico 2018-12-17 16:26:26 +01:00
parent 5048776016
commit f9251445f3
1 changed files with 20 additions and 2 deletions

View File

@ -123,7 +123,7 @@ server {
{% endif %} {% endif %}
{% if item.locations is defined %} {% if item.locations is defined %}
{% for location in item.locations %} {% for location in item.locations -%}
location {{ location.location }} { location {{ location.location }} {
@ -137,6 +137,15 @@ server {
{% if location.target is defined %} {% if location.target is defined %}
proxy_pass {{ location.target }}; proxy_pass {{ location.target }};
{% elif location.php_target is defined %}
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass {{ location.php_target }};
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#fastcgi_param REMOTE_ADDR $http_x_forwarded_for;
#fastcgi_param REMOTE_ADDR $remote_addr;
include fastcgi_params;
{% endif %} {% endif %}
{% if location.websockets is defined and location.websockets %} {% if location.websockets is defined and location.websockets %}
@ -274,7 +283,7 @@ server {
{% endif %} {% endif %}
{% if item.locations is defined %} {% if item.locations is defined %}
{% for location in item.locations %} {% for location in item.locations -%}
location {{ location.location }} { location {{ location.location }} {
{% if nginx_cors_enabled %} {% if nginx_cors_enabled %}
@ -287,6 +296,15 @@ server {
{% if location.target is defined %} {% if location.target is defined %}
proxy_pass {{ location.target }}; proxy_pass {{ location.target }};
{% elif location.php_target is defined %}
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass {{ location.php_target }};
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#fastcgi_param REMOTE_ADDR $http_x_forwarded_for;
#fastcgi_param REMOTE_ADDR $remote_addr;
include fastcgi_params;
{% endif %} {% endif %}
{% if location.websockets is defined and location.websockets %} {% if location.websockets is defined and location.websockets %}