upstream php-fpm
{
# PHP5-FPM сервер
server unix:/var/run/php5-fpm.sock;
}
server
{
include common/upstream;
include common/php-fpm;
include common/cache;
listen 80;
listen 443 ssl; # использовать шифрование для этого порта
root /var/www/phalcon/public;
index index.php index.html index.htm;
server_name stuffplace.ru www.stuffplace.ru;
...
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index /index.php;
# Для приложения на PHP
server {
server_name php1.mydomen.com;
location ~* \.php$ {
try_files $uri = 404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass IP_OF_CONTAINER:FPM_PORT; # подключаем сокет php-fpm
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
#Для python приложения (uwsgi)
server {
server_name python1.mydomen.com
location / {
uwsgi_pass IP_OF_CONTAINER:UWSGI_PORT;
include /path/to/your/mysite/uwsgi_params; # the uwsgi_params file you installed
}
}
if ($http_user_agent ~* (AhrefsBot|majestic) ) {
return 403;
}
[user]
user = user
group = user
listen = /run/php/php7.0-user.sock
listen.owner = www-data
listen.group = www-data
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
chdir = /
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.0-user.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}