
user  nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}





http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;
server {
    listen 80;
    listen [::]:80;
    location /{
      root /guest/downloads;
      autoindex on;
      autoindex_exact_size off;
      autoindex_localtime off;
}}
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;


# Settings for a TLS enabled server.
#
    server {
        listen       443 ssl ;
        listen       [::]:443 ssl ;
#        server_name  _;
#        root         /usr/share/nginx/html;
#
        ssl_certificate /etc/nginx/ssl/us.tomserver.xyz.crt;
        ssl_certificate_key /etc/nginx/ssl/us.tomserver.xyz.key;
        ssl_protocols         TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers           HIGH:!aNULL:!MD5;
	server_name us.tomserver.xyz;

	location /Downloads {
       	 proxy_redirect off;
       	 proxy_pass http://127.0.0.1:20829;  #v2ray���õ�websocks�˿ں�
       	 proxy_http_version 1.1;
       	 proxy_set_header Upgrade $http_upgrade;
         proxy_set_header Connection "upgrade";
         proxy_set_header Host $http_host;
         proxy_set_header X-Real-IP $remote_addr;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_connect_timeout 60s;
         proxy_read_timeout 86400s;
         proxy_send_timeout 60s;
	}
	location /pan {
		alias /guest/downloads;
		autoindex on;
		autoindex_format html;
		autoindex_exact_size off;
		autoindex_localtime on;
        }
}
# Settings for a TLS enabled server.
#
    server {
        listen       443 ssl ;
        listen       [::]:443 ssl ;
#        server_name  _;
#        root         /usr/share/nginx/html;
#
        ssl_certificate /etc/nginx/ssl/us.tomserver.xyz.crt;
        ssl_certificate_key /etc/nginx/ssl/us.tomserver.xyz.key;
        ssl_protocols         TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers           HIGH:!aNULL:!MD5;
	server_name cdn.us.tomserver.xyz;

	location /Downloads {
       	 proxy_redirect off;
       	 proxy_pass http://127.0.0.1:20829;  #v2ray���õ�websocks�˿ں�
       	 proxy_http_version 1.1;
       	 proxy_set_header Upgrade $http_upgrade;
         proxy_set_header Connection "upgrade";
         proxy_set_header Host $http_host;
         proxy_set_header X-Real-IP $remote_addr;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_connect_timeout 60s;
         proxy_read_timeout 86400s;
         proxy_send_timeout 60s;
	}
	location /pan {
		alias /guest/downloads;
		autoindex on;
		autoindex_format html;
		autoindex_exact_size off;
		autoindex_localtime on;
        }
}



}

