-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.proxy
30 lines (26 loc) · 1021 Bytes
/
nginx.proxy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
`echo "server {
listen 80;
server_name YOUR_ONION.ONION;
index index.html;
root /var/www/onion/; # fallback for index.php
location / YOUR REMOTE_ONION.ONION {
try_files $uri $uri/ /index.php?$query_string;
}location /index.php {
proxy_pass REMOTE_SERVER_IP/;proxy_http_version 1.1;
proxy_cache_bypass $http_upgrade;
# Proxy headers
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
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 X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
# Proxy timeouts
proxy_connect_timeout 60s;
proxy_send_timeout 60s;
proxy_read_timeout 60s;
}
" > /etc/nginx/conf.d/onion.conf`;
cp /etc/nginx/conf.d/onion.conf /etc/nginx/sites-available/onion.conf &&