d2ray/image/nginx/nginx.conf
quackerd 882e3e5e41
All checks were successful
continuous-integration/drone/push Build is passing
Update 'image/nginx/nginx.conf'
2021-04-23 08:23:14 +00:00

47 lines
771 B
Nginx Configuration File

user www www;
worker_processes auto;
error_log /opt/config/logs/nginx/error.log;
pid /tmp/nginx.pid;
events {
worker_connections 4096; ## Default: 1024
}
http {
geo $external {
default 1;
127.0.0.1/32 0;
}
##
# WebSocket proxying
##
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
charset utf-8;
server {
listen 80 default_server;
server_name _;
access_log /opt/config/logs/nginx/access.log;
if ($external) {
return 301 https://$host$request_uri;
}
location / {
root /opt/nginx/webroot;
index index.html;
}
location /download {
root /opt/nginx/;
autoindex on;
auth_basic "Provide credentials to access downloads";
auth_basic_user_file "/opt/nginx/.htpasswd";
}
}
}