Skip to content

Instantly share code, notes, and snippets.

@victorhugorch
Created February 20, 2018 21:34
Show Gist options
  • Save victorhugorch/09223b23c27c0f48808af4c512cdf6ba to your computer and use it in GitHub Desktop.
Save victorhugorch/09223b23c27c0f48808af4c512cdf6ba to your computer and use it in GitHub Desktop.
nginx/vhosts
server {
listen 80;
server_name degraucultural.wama.com.br;
root /var/www/degraucultural/public;
index index.html index.htm index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php$is_args$args;
auth_basic "Restricted Content";
auth_basic_user_file /etc/nginx/.htpasswd;
}
error_log /var/logs/nginx/degraucultural-error.log;
access_log /var/logs/nginx/degraucultural-access.log;
client_max_body_size 20M;
location ~ \.php$ {
fastcgi_pass degraucultural-upstream;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors off;
}
location ~ /\.ht {
deny all;
}
}
server {
listen 80;
server_name localhost;
root /var/www/folhadirigida/public;
index index.html index.htm index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php$is_args$args;
auth_basic "Restricted Content";
auth_basic_user_file /etc/nginx/.htpasswd;
}
error_log /var/logs/nginx/folhadirigida-error.log;
access_log /var/logs/nginx/folhadirigida-access.log;
client_max_body_size 20M;
location ~ \.php$ {
fastcgi_pass folhadirigida-upstream;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors off;
}
location ~ /\.ht {
deny all;
}
}
upstream folhadirigida-upstream { server folhadirigida_php:9000; }
upstream folhadirigida-serverfiles-upstream { server folhadirigida_serverfiles_php:9000; }
upstream degraucultural-upstream { server degraucultural_php:9000; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment