Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method for issue #172 #282

Open
wants to merge 1 commit into
base: D7
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/drupal/admin_basic_auth.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ location ^~ /admin {
## Include the specific FastCGI configuration. This is for a
## FCGI backend like php-cgi or php-fpm.
include apps/drupal/fastcgi_drupal.conf;
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;
}
10 changes: 5 additions & 5 deletions apps/drupal/drupal.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ location / {
## Include the specific FastCGI configuration. This is for a
## FCGI backend like php-cgi or php-fpm.
include apps/drupal/fastcgi_drupal.conf;
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;

## If proxying to apache comment the two lines above and
## uncomment the two lines below.
Expand All @@ -50,7 +50,7 @@ location / {
## Include the specific FastCGI configuration. This is for a
## FCGI backend like php-cgi or php-fpm.
include apps/drupal/fastcgi_drupal.conf;
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;

## If proxying to apache comment the two lines above and
## uncomment the two lines below.
Expand Down Expand Up @@ -199,7 +199,7 @@ location / {
## Include the specific FastCGI configuration. This is for a
## FCGI backend like php-cgi or php-fpm.
include apps/drupal/fastcgi_drupal.conf;
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;

## If proxying to apache comment the two lines above and
## uncomment the two lines below.
Expand Down Expand Up @@ -232,7 +232,7 @@ location / {
location @drupal {
## Include the FastCGI config.
include apps/drupal/fastcgi_drupal.conf;
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;

## FastCGI microcache.
include apps/drupal/microcache_fcgi.conf;
Expand All @@ -259,7 +259,7 @@ location @drupal-no-args {
## Include the specific FastCGI configuration. This is for a
## FCGI backend like php-cgi or php-fpm.
include apps/drupal/fastcgi_no_args_drupal.conf;
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;

## FastCGI microcache.
include apps/drupal/microcache_fcgi.conf;
Expand Down
12 changes: 6 additions & 6 deletions apps/drupal/drupal_boost.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ location / {
## Include the specific FastCGI configuration. This is for a
## FCGI backend like php-cgi or php-fpm.
include apps/drupal/fastcgi_drupal.conf;
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;

## If proxying to apache comment the two lines above and
## uncomment the line below.
Expand All @@ -50,7 +50,7 @@ location / {
## Include the specific FastCGI configuration. This is for a
## FCGI backend like php-cgi or php-fpm.
include apps/drupal/fastcgi_drupal.conf;
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;

## If proxying to apache comment the two lines above and
## uncomment the line below.
Expand Down Expand Up @@ -192,7 +192,7 @@ location / {
## Include the specific FastCGI configuration. This is for a
## FCGI backend like php-cgi or php-fpm.
include apps/drupal/fastcgi_drupal.conf;
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;

## If proxying to apache comment the two lines above and
## uncomment the line below.
Expand Down Expand Up @@ -263,7 +263,7 @@ location @cache {
location @drupal {
## Include the FastCGI config.
include apps/drupal/fastcgi_drupal.conf;
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;

## FCGI microcache for authenticated users also.
include apps/drupal/microcache_fcgi_auth.conf;
Expand All @@ -285,7 +285,7 @@ location @drupal-no-args {
## Include the specific FastCGI configuration. This is for a
## FCGI backend like php-cgi or php-fpm.
include apps/drupal/fastcgi_no_args_drupal.conf;
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;

## FCGI microcache for authenticated users also.
include apps/drupal/microcache_fcgi_auth.conf;
Expand Down Expand Up @@ -369,7 +369,7 @@ location ~* ^.+\.php$ {

## Boost stats.
location = /boost_stats.php {
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;
## To use Apache for serving PHP uncomment the line bellow and
## comment out the above.
#proxy_pass http://phpapache;
Expand Down
12 changes: 6 additions & 6 deletions apps/drupal/drupal_boost_escaped.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ location / {
## Include the specific FastCGI configuration. This is for a
## FCGI backend like php-cgi or php-fpm.
include apps/drupal/fastcgi_drupal.conf;
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;

## If proxying to apache comment the two lines above and
## uncomment the line below.
Expand All @@ -53,7 +53,7 @@ location / {
## Include the specific FastCGI configuration. This is for a
## FCGI backend like php-cgi or php-fpm.
include apps/drupal/fastcgi_drupal.conf;
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;

## If proxying to apache comment the two lines above and
## uncomment the line below.
Expand Down Expand Up @@ -195,7 +195,7 @@ location / {
## Include the specific FastCGI configuration. This is for a
## FCGI backend like php-cgi or php-fpm.
include apps/drupal/fastcgi_drupal.conf;
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;

## If proxying to apache comment the two lines above and
## uncomment the line below.
Expand Down Expand Up @@ -267,7 +267,7 @@ location @cache {
location @drupal {
## Include the FastCGI config.
include apps/drupal/fastcgi_drupal.conf;
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;

## FCGI microcache for authenticated users also.
include apps/drupal/microcache_fcgi_auth.conf;
Expand All @@ -289,7 +289,7 @@ location @drupal-no-args {
## Include the specific FastCGI configuration. This is for a
## FCGI backend like php-cgi or php-fpm.
include apps/drupal/fastcgi_no_args_drupal.conf;
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;

## FCGI microcache for authenticated users also.
include apps/drupal/microcache_fcgi_auth.conf;
Expand Down Expand Up @@ -373,7 +373,7 @@ location ~* ^.+\.php$ {

## Boost stats.
location = /boost_stats.php {
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;
## To use Apache for serving PHP uncomment the line bellow and
## comment out the above.
#proxy_pass http://phpapache;
Expand Down
8 changes: 4 additions & 4 deletions apps/drupal/drupal_cron_update.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

## XMLRPC. Comment out if not enabled.
location = /xmlrpc.php {
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;
# To use Apache for serving PHP uncomment the line bellow and
# comment out the above.
#proxy_pass http://phpapache;
Expand All @@ -16,15 +16,15 @@ location = /cron.php {
if ($not_allowed_cron) {
return 404 /;
}
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;
## To use Apache for serving PHP uncomment the line bellow and
## comment out the above.
#proxy_pass http://phpapache;
}

## Run the update from the web interface with Drupal 7.
location = /authorize.php {
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;
## To use Apache for serving PHP uncomment the line bellow and
## comment out the above.
#proxy_pass http://phpapache;
Expand All @@ -33,7 +33,7 @@ location = /authorize.php {
location = /update.php {
auth_basic "Restricted Access"; # auth realm
auth_basic_user_file .htpasswd-users; # htpasswd file
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;
## To use Apache for serving PHP uncomment the line bellow and
## comment out the above.
#proxy_pass http://phpapache;
Expand Down
10 changes: 5 additions & 5 deletions apps/drupal/drupal_escaped.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ location / {
## Include the specific FastCGI configuration. This is for a
## FCGI backend like php-cgi or php-fpm.
include apps/drupal/fastcgi_drupal.conf;
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;

## If proxying to apache comment the two lines above and
## uncomment the line below.
Expand All @@ -53,7 +53,7 @@ location / {
## Include the specific FastCGI configuration. This is for a
## FCGI backend like php-cgi or php-fpm.
include apps/drupal/fastcgi_drupal.conf;
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;

## If proxying to apache comment the two lines above and
## uncomment the line below.
Expand Down Expand Up @@ -201,7 +201,7 @@ location / {
## Include the specific FastCGI configuration. This is for a
## FCGI backend like php-cgi or php-fpm.
include apps/drupal/fastcgi_drupal.conf;
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;

## If proxying to apache comment the two lines above and
## uncomment the line below.
Expand Down Expand Up @@ -233,7 +233,7 @@ location / {
location @drupal {
## Include the FastCGI config.
include apps/drupal/fastcgi_drupal.conf;
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;

## FastCGI microcache.
include apps/drupal/microcache_fcgi.conf;
Expand All @@ -259,7 +259,7 @@ location @drupal-no-args {
## Include the specific FastCGI configuration. This is for a
## FCGI backend like php-cgi or php-fpm.
include apps/drupal/fastcgi_no_args_drupal.conf;
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;

## FastCGI microcache.
include apps/drupal/microcache_fcgi.conf;
Expand Down
4 changes: 2 additions & 2 deletions apps/drupal/drupal_install.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
location = /install.php {
auth_basic "Restricted Access"; # auth realm
auth_basic_user_file .htpasswd-users; # htpasswd file
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;
}

## This is for drupal 8. There's a new location for the install file.
location = /core/install.php {
auth_basic "Restricted Access"; # auth realm
auth_basic_user_file .htpasswd-users; # htpasswd file
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;
}
4 changes: 2 additions & 2 deletions php_fpm_status_vhost.conf
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ location = /fpm-status-drei {
if ($dont_show_fpm_status) {
return 404;
}
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;
access_log off;
}

Expand All @@ -74,6 +74,6 @@ location = /ping-drei {
if ($dont_show_fpm_status) {
return 404;
}
fastcgi_pass phpcgi;
fastcgi_pass $custom_upstream;
access_log off;
}
3 changes: 3 additions & 0 deletions sites-available/000-default
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
### a suggestion by Maxim Dounin. Also suggested in
### http://nginx.org/en/docs/http/request_processing.html#how_to_prevent_undefined_server_names.
server {
## Set upstream.
set $custom_upstream phpcgi;

listen 80 default_server; # IPv4
## Socket options can only be specified once, hence the different
## address for the 'default' server.
Expand Down
3 changes: 3 additions & 0 deletions sites-available/example.com.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ server {
listen [fe80::202:b3ff:fe1e:8330]:80 ipv6only=on;

server_name example.com;
set $custom_upstream phpcgi_examplecom;
limit_conn arbeit 32;

## Access and error logs.
Expand Down Expand Up @@ -133,6 +134,7 @@ server {
## Uncomment the line below if you're using SPDY.
#listen [fe80::202:b3ff:fe1e:8329]:443 ssl spdy ipv6only=on;

set $custom_upstream phpcgi_examplecom;
server_name www.example.com;

## Keep alive timeout set to a greater value for SSL/TLS.
Expand Down Expand Up @@ -161,6 +163,7 @@ server {
## Uncomment the line below if you're using SPDY.
#listen [fe80::202:b3ff:fe1e:8330]:443 ssl spdy ipv6only=on;

set $custom_upstream phpcgi_examplecom;
server_name example.com;

limit_conn arbeit 32;
Expand Down
7 changes: 7 additions & 0 deletions upstream_phpcgi_unix.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ upstream phpcgi {
keepalive 5;
}

## Demo upstream for example.com vhost
upstream phpcgi_examplecom {
least_conn;
server unix:/var/run/php-fpm-examplecom.sock;
keepalive 5;
}

## Add a third pool as a fallback. Note that this requires php-cgi
## side by side php-fpm. If you don't have it installed comment it
## out.
Expand Down