UNPKG

hudada-cli

Version:

专为程序员准备的本地文档搜索,快捷开发工具

219 lines (162 loc) 5.77 kB
#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; #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 logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; limit_req_zone $binary_remote_addr zone=req_zone:10m rate=1r/s; server { listen 80; server_name localhost; location / { root html; index index.html index.htm; } } resolver 8.8.8.8; autoindex off;# 显示目录 autoindex_exact_size on;# 显示文件大小 autoindex_localtime on;# 显示文件时间 server { listen 9050; root C:\Users\Administrator\Pictures; index 1.png; location / { autoindex off; autoindex_exact_size on; autoindex_localtime on; } location ~.*\.(jpg|png|gif)$ { autoindex off; valid_referers none blocked 192.168.0.1; if ($invalid_referer) { # rewrite ^/ http://$host/imgs/123.png; } } } server { listen 443 ssl; server_name localhost; ssl_certificate C:\sqlite\localhost.pem; ssl_certificate_key C:\sqlite\localhost-key.pem; ssl_session_cache shared:SSL:1m; ssl_session_timeout 5m; #数字签名,此处使用MD5 ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; #charset koi8-r; #access_log logs/host.access.log main; location ~ .*\.(js|css|json|mp3|html|wav)$ { gzip on; root typing-word/dist; gzip_min_length 900k; gzip_comp_level 9; gzip_types text/css application/javascript application/json audio/mp3 audio/mpeg application/octet-stream; valid_referers none blocked localhost; # if ($invalid_referer) { # return 403; # } access_log typing-word/log/access.log; expires 1d; } location /NginxStatus { stub_status on; access_log on; auth_basic "NginxStatus"; auth_basic_user_file conf/htpasswd; } location / { root typing-word/dist; index index.html index.htm; limit_req zone=req_zone burst=5 nodelay; add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization'; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Expose-Headers' 'Content-Range,X-Total-Count'; add_header 'Access-Control-Max-Age' '600'; } location /assets { proxy_pass https://www.baidu.com/; } location /html { proxy_pass http://localhost:80/index.html; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; # deny 127.0.0.1; # deny 192.168.1.3; proxy_set_header X-Real-IP $remote_addr; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root html; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } # another virtual host using mix of IP-, name-, and port-based configuration # #server { # listen 8000; # listen somename:8080; # server_name somename alias another.alias; # location / { # root html; # index index.html index.htm; # } #} # HTTPS server # #server { # listen 443 ssl; # server_name localhost; # ssl_certificate cert.pem; # ssl_certificate_key cert.key; # ssl_session_cache shared:SSL:1m; # ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; # location / { # root html; # index index.html index.htm; # } #} }