12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- worker_processes 2; ## 默认1,一般建议设成CPU核数1-2倍
- events {
- worker_connections 2048;
- }
- http {
- access_log ./access.log;
- error_log ./error.log;
- client_max_body_size 1024m;
- default_type application/octet-stream; # 默认文件类型
- # 日志格式及access日志路径
- log_format main '$remote_addr - $remote_user [$time_local] $status '
- '"$request" $body_bytes_sent "$http_referer" '
- '"$http_user_agent" "$http_x_forwarded_for"';
- sendfile on;
- tcp_nopush on; # sendfile开启时才开启。
- proxy_connect_timeout 900; #单位秒
- proxy_send_timeout 900; #单位秒
- proxy_read_timeout 900; #单位秒
- server {
- listen 80;
- proxy_hide_header 'Vary';
- add_header 'Access-Control-Allow-Origin' '*' always;
- add_header 'Access-Control-Allow-Methods' '*' always;
- add_header 'Access-Control-Allow-Headers' '*' always;
- location / {
- if ($request_method = OPTIONS) {
- add_header 'Access-Control-Allow-Origin' '*' always;
- add_header 'Access-Control-Allow-Methods' '*' always;
- add_header 'Access-Control-Allow-Headers' '*' always;
- return 204;
- }
- proxy_pass https://www.youtube.com/;
- }
- }
- server {
- listen 81;
- proxy_hide_header 'Vary';
- add_header 'Access-Control-Allow-Origin' '*' always;
- add_header 'Access-Control-Allow-Methods' '*' always;
- add_header 'Access-Control-Allow-Headers' '*' always;
- location / {
- if ($request_method = OPTIONS) {
- add_header 'Access-Control-Allow-Origin' '*' always;
- add_header 'Access-Control-Allow-Methods' '*' always;
- add_header 'Access-Control-Allow-Headers' '*' always;
- return 204;
- }
- proxy_pass https://cn.pornhub.com/;
- }
- }
- server {
- listen 82;
- proxy_hide_header 'Vary';
- add_header 'Access-Control-Allow-Origin' '*' always;
- add_header 'Access-Control-Allow-Methods' '*' always;
- add_header 'Access-Control-Allow-Headers' '*' always;
- location / {
- if ($request_method = OPTIONS) {
- add_header 'Access-Control-Allow-Origin' '*' always;
- add_header 'Access-Control-Allow-Methods' '*' always;
- add_header 'Access-Control-Allow-Headers' '*' always;
- return 204;
- }
- proxy_pass https://www.xvideos.com/;
- }
- }
- server {
- listen 83;
- proxy_hide_header 'Vary';
- add_header 'Access-Control-Allow-Origin' '*' always;
- add_header 'Access-Control-Allow-Methods' '*' always;
- add_header 'Access-Control-Allow-Headers' '*' always;
- location / {
- if ($request_method = OPTIONS) {
- add_header 'Access-Control-Allow-Origin' '*' always;
- add_header 'Access-Control-Allow-Methods' '*' always;
- add_header 'Access-Control-Allow-Headers' '*' always;
- return 204;
- }
- proxy_pass https://music.youtube.com/;
- }
- }
- }
|