mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 16:19:13 +02:00
Initial version of nginx parser roundtrip test
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
server {
|
||||
server_name domain.tld www.domain.tld;
|
||||
root /var/www/project/web;
|
||||
|
||||
location / {
|
||||
# try to serve file directly, fallback to app.php
|
||||
try_files $uri /app.php$is_args$args;
|
||||
}
|
||||
# DEV
|
||||
# This rule should only be placed on your development environment
|
||||
# In production, don't include this and don't deploy app_dev.php or config.php
|
||||
location ~ ^/(app_dev|config)\.php(/|$) {
|
||||
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
||||
include fastcgi_params;
|
||||
# When you are using symlinks to link the document root to the
|
||||
# current version of your application, you should pass the real
|
||||
# application path instead of the path to the symlink to PHP
|
||||
# FPM.
|
||||
# Otherwise, PHP's OPcache may not properly detect changes to
|
||||
# your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
|
||||
# for more information).
|
||||
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
|
||||
fastcgi_param DOCUMENT_ROOT $realpath_root;
|
||||
}
|
||||
# PROD
|
||||
location ~ ^/app\.php(/|$) {
|
||||
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
||||
include fastcgi_params;
|
||||
# When you are using symlinks to link the document root to the
|
||||
# current version of your application, you should pass the real
|
||||
# application path instead of the path to the symlink to PHP
|
||||
# FPM.
|
||||
# Otherwise, PHP's OPcache may not properly detect changes to
|
||||
# your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
|
||||
# for more information).
|
||||
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
|
||||
fastcgi_param DOCUMENT_ROOT $realpath_root;
|
||||
# Prevents URIs that include the front controller. This will 404:
|
||||
# http://domain.tld/app.php/some-path
|
||||
# Remove the internal directive to allow URIs like this
|
||||
internal;
|
||||
}
|
||||
|
||||
# return 404 for all other php files not matching the front controller
|
||||
# this prevents access to other php files you don't want to be accessible.
|
||||
location ~ \.php$ {
|
||||
return 404;
|
||||
}
|
||||
|
||||
error_log /var/log/nginx/project_error.log;
|
||||
access_log /var/log/nginx/project_access.log;
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
upstream phpfcgi {
|
||||
server 127.0.0.1:9000;
|
||||
# server unix:/var/run/php5-fpm.sock; #for PHP-FPM running on UNIX socket
|
||||
}
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
server_name symfony2;
|
||||
root /var/www/symfony2/web;
|
||||
|
||||
error_log /var/log/nginx/symfony2.error.log;
|
||||
access_log /var/log/nginx/symfony2.access.log;
|
||||
|
||||
# strip app.php/ prefix if it is present
|
||||
rewrite ^/app\.php/?(.*)$ /$1 permanent;
|
||||
|
||||
location / {
|
||||
index app.php;
|
||||
try_files $uri @rewriteapp;
|
||||
}
|
||||
|
||||
location @rewriteapp {
|
||||
rewrite ^(.*)$ /app.php/$1 last;
|
||||
}
|
||||
|
||||
# pass the PHP scripts to FastCGI server from upstream phpfcgi
|
||||
location ~ ^/(app|app_dev|config)\.php(/|$) {
|
||||
fastcgi_pass phpfcgi;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param HTTPS off;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
server {
|
||||
listen 443;
|
||||
|
||||
server_name symfony2;
|
||||
root /var/www/symfony2/web;
|
||||
|
||||
ssl on;
|
||||
ssl_certificate /etc/ssl/certs/symfony2.crt;
|
||||
ssl_certificate_key /etc/ssl/private/symfony2.key;
|
||||
|
||||
error_log /var/log/nginx/symfony2.error.log;
|
||||
access_log /var/log/nginx/symfony2.access.log;
|
||||
|
||||
# strip app.php/ prefix if it is present
|
||||
rewrite ^/app\.php/?(.*)$ /$1 permanent;
|
||||
|
||||
location / {
|
||||
index app.php;
|
||||
try_files $uri @rewriteapp;
|
||||
}
|
||||
|
||||
location @rewriteapp {
|
||||
rewrite ^(.*)$ /app.php/$1 last;
|
||||
}
|
||||
|
||||
# pass the PHP scripts to FastCGI server from upstream phpfcgi
|
||||
location ~ ^/(app|app_dev|config)\.php(/|$) {
|
||||
fastcgi_pass phpfcgi;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param HTTPS on;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
server_name mysite.com;
|
||||
|
||||
root /var/www/mysite.com/web;
|
||||
access_log /var/log/nginx/mysite.com.access.log;
|
||||
error_log /var/log/nginx/mysite.com.error.log;
|
||||
|
||||
location ~ ^/(index|frontend|frontend_dev|backend|backend_dev)\.php$ {
|
||||
include fastcgi_params;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
|
||||
fastcgi_param HTTPS off;
|
||||
fastcgi_pass 127.0.0.1:9000;
|
||||
}
|
||||
|
||||
location / {
|
||||
index index.php;
|
||||
try_files $uri /index.php?$args;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443;
|
||||
|
||||
ssl on;
|
||||
ssl_certificate /etc/ssl/certs/mysite.com.crt;
|
||||
ssl_certificate_key /etc/ssl/private/mysite.com.key;
|
||||
|
||||
server_name mysite.com;
|
||||
|
||||
root /var/www/mysite.com/web;
|
||||
access_log /var/log/nginx/mysite.com.access.log;
|
||||
error_log /var/log/nginx/mysite.com.error.log;
|
||||
location ~ ^/(index|frontend|frontend_dev|backend|backend_dev)\.php$ {
|
||||
include fastcgi_params;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
|
||||
fastcgi_param HTTPS on;
|
||||
fastcgi_pass 127.0.0.1:9000;
|
||||
}
|
||||
|
||||
location / {
|
||||
index index.php;
|
||||
try_files $uri /index.php?$args;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user