usersockets on seperate subdomain

This commit is contained in:
root 2022-10-29 13:20:37 -04:00
parent 12159d80fd
commit 602f5b6e43
4 changed files with 45 additions and 12 deletions

View File

@ -0,0 +1,14 @@
add_header Onion-Location http://0$user.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion$request_uri;
error_log /var/log/nginx/vern.cc-error.log info;
ssi on;
location / {
proxy_pass http://unix:/var/socks/$user.sock;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}

View File

@ -1,15 +1,6 @@
add_header Onion-Location http://$user.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion$request_uri;
error_log /var/log/nginx/vern.cc-error.log info;
location @socket {
proxy_pass http://unix:/var/socks/$user.sock;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
root /sshfs/home/$user/public_html;
index index.html index.php index.cgi index.py index.sh index.pl index.lua;

View File

@ -0,0 +1,29 @@
server {
listen 80;
listen [::]:80;
server_name ~^0(?<user>[^.]+)\.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad\.onion;
include common/usersites-socket.conf;
error_page 502 =307 http://vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name ~^0(?<user>[^.]+)\.vern\.cc;
include snippets/lets-encrypt.conf;
include common/usersites-socket.conf;
error_page 502 =307 https://vern.cc;
}
server {
listen 80;
listen [::]:80;
return 301 https://$host$request_uri;
server_name ~^0(?<user>[^.]+)\.vern\.cc;
}

View File

@ -8,7 +8,7 @@ server {
location / {
#try_files @socket =404;
try_files @socket $uri $uri/index.html $uri.html $uri/ @extensionless-php;
try_files $uri $uri/index.html $uri.html $uri/ @extensionless-php;
if (!-d /vm/$user/public_html) {
return 307 http://vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion/;
}
@ -26,7 +26,7 @@ server {
location / {
#try_files @socket =404;
try_files @socket $uri $uri/index.html $uri.html $uri/ @extensionless-php;
try_files $uri $uri/index.html $uri.html $uri/ @extensionless-php;
if (!-d /vm/$user/public_html) {
return 307 https://vern.cc/;
}
@ -40,4 +40,3 @@ server {
return 301 https://$host$request_uri;
server_name ~^(?<user>[^.]+)\.vern\.cc;
}