Last active
December 4, 2018 01:54
-
-
Save jueti/55b0ccaef39d16ec753243f13927d7ab to your computer and use it in GitHub Desktop.
[Nginx & FRP 共用80端口] 方案一:主域名的站点位于服务器,三级泛域名位于本地 #nginx #frp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name www.jasonyang.xin jasonyang.xin; | |
return 301 https://www.jasonyang.xin$request_uri; | |
} | |
server { | |
listen 443 ssl http2; | |
server_name www.jasonyang.xin jasonyang.xin; | |
ssl_certificate /etc/ssl/certs/1578714_www.jasonyang.xin.pem; | |
ssl_certificate_key /etc/ssl/certs/1578714_www.jasonyang.xin.key; | |
ssl_session_timeout 5m; | |
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_prefer_server_ciphers on; | |
gzip on; | |
gzip_min_length 1k; | |
gzip_comp_level 6; | |
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png; | |
location / { | |
root /usr/share/nginx/html; | |
index index.html index.htm; | |
} | |
} | |
server { | |
listen 80; | |
server_name *.frp.jasonyang.xin; | |
location / { | |
resolver 114.114.114.114 8.8.8.8; | |
proxy_pass $scheme://$host:7000; | |
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 Host $host:$server_port; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[common] | |
bind_addr = 0.0.0.0 | |
bind_port = 7000 | |
kcp_bind_port = 7000 | |
bind_udp_port = 7001 | |
vhost_http_port = 7000 | |
vhost_https_port = 7000 | |
tcp_mux = true | |
token = ****** | |
max_pool_count = 100 | |
dashboard_port = 7500 | |
dashboard_user = ****** | |
dashboard_pwd = ****** | |
authentication_timeout = 0 | |
subdomain_host = frp.jasonyang.xin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment