ops/etc/nginx/snippets/user.envs.conf

48 lines
1007 B
Plaintext

root /home/$user/public_html;
index index.html index.php index.cgi index.py index.sh index.pl index.lua;
include snippets/php.conf;
include fastcgi_params;
ssi on;
error_page 404 /404.html;
fancyindex on;
fancyindex_exact_size off;
location / {
try_files $uri $uri.html $uri/ @extensionless-php;
}
location @extensionless-php {
rewrite ^(.*)$ $1.php last;
}
location ~ (\.cgi|\.py|\.sh|\.pl|\.lua|\/cgi-bin)$ {
gzip off;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
}
location ~ /restricted/ {
auth_basic "Restricted Area";
auth_basic_user_file /home/$user/.htpasswd;
}
if (!-d /home/$user/public_html) {
return 307 https://envs.net/;
}
#if (!-f /home/$user/.weechat/relay_socket) {
# return 404;
#}
location /weechat {
proxy_pass http://unix:/home/$user/.weechat/relay_socket:/weechat;
include proxy_params;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
limit_req zone=weechat burst=1 nodelay; # Brute force prevention
}