diff --git a/install/rhel/templates/web/nginx/default.stpl b/install/rhel/templates/web/nginx/default.stpl index 6f1b8659f..3cf33f79d 100755 --- a/install/rhel/templates/web/nginx/default.stpl +++ b/install/rhel/templates/web/nginx/default.stpl @@ -1,30 +1,25 @@ server { listen %ip%:%proxy_ssl_port%; server_name %domain_idn% %alias_idn%; + index index.html index.htm; + root %sdocroot%; ssl on; ssl_certificate %ssl_pem%; ssl_certificate_key %ssl_key%; error_log /var/log/httpd/domains/%domain%.error.log error; - - location / { - proxy_pass https://%ip%:%web_ssl_port%; - location ~* ^.+\.(%proxy_extentions%)$ { - root %sdocroot%; + location / {try_files $uri @backend;} + location ~ .*\.(php|jsp|cgi|pl|py|php4|php5)?$ { + access_log off; + proxy_pass https://%ip%:%web_ssl_port%; + } + location ~* ^.+\.(%proxy_extentions%)$ { access_log /var/log/httpd/domains/%domain%.log combined; access_log /var/log/httpd/domains/%domain%.bytes bytes; expires max; - try_files $uri @fallback; - } + try_files $uri @backend; } - - location /error/ { - alias %home%/%user%/web/%domain%/document_errors/; - } - - location @fallback { - proxy_pass https://%ip%:%web_ssl_port%; - } - + location @backend {proxy_pass https://%ip%:%web_ssl_port%;} + location /error/ {alias %home%/%user%/web/%domain%/document_errors/;} location ~ .*\.(mp3|ftpquota|htaccess|svn|ht|git|hg|bzr)?\$ {deny all;} }