From 72cfae0429ac97a180d73b3f74398bce3758c946 Mon Sep 17 00:00:00 2001 From: shylinux Date: Mon, 15 Aug 2022 12:26:47 +0800 Subject: [PATCH] opt some --- etc/conf/header.conf | 4 ++++ etc/conf/location.conf | 15 +++++++-------- etc/conf/nginx.conf | 38 +++----------------------------------- etc/miss.sh | 2 +- go.mod | 14 ++++++++++++++ go.sum | 15 --------------- 6 files changed, 29 insertions(+), 59 deletions(-) create mode 100644 etc/conf/header.conf diff --git a/etc/conf/header.conf b/etc/conf/header.conf new file mode 100644 index 00000000..61bfaa37 --- /dev/null +++ b/etc/conf/header.conf @@ -0,0 +1,4 @@ +proxy_set_header X-HOST $scheme://$http_host; +proxy_set_header X-Real-Port $remote_port; +proxy_set_header X-Real-IP $remote_addr; + diff --git a/etc/conf/location.conf b/etc/conf/location.conf index 0f2d925a..80459f82 100644 --- a/etc/conf/location.conf +++ b/etc/conf/location.conf @@ -11,21 +11,20 @@ client_body_in_file_only clean; client_body_buffer_size 16K; client_body_temp_path /tmp/nginx/client_body_temp; - location / { + include header.conf; proxy_pass http://127.0.0.1:9020; - include headers.conf; -} - -location /x/ { - proxy_pass http://127.0.0.1:9030; - include headers.conf; } location /space/ { + include header.conf; proxy_pass http://127.0.0.1:9020; proxy_set_header Connection "upgrade"; proxy_set_header Upgrade $http_upgrade; - include headers.conf; +} + +location /x/ { + include header.conf; + proxy_pass http://127.0.0.1:9030; } diff --git a/etc/conf/nginx.conf b/etc/conf/nginx.conf index 158982cb..15875075 100644 --- a/etc/conf/nginx.conf +++ b/etc/conf/nginx.conf @@ -9,44 +9,12 @@ http { proxy_buffering off; keepalive_timeout 1800; - server { - listen 80; - server_name contexts.top; - location / { return 302 https://contexts.top/; } - } - - server { - listen 443 ssl; - server_name contexts.top; - - ssl_certificate_key contexts.top_nginx/contexts.top.key; - ssl_certificate contexts.top_nginx/contexts.top_bundle.pem; - - include location.conf; - } - - server { - listen 80; - server_name contexts.com.cn; - location / { return 302 https://contexts.com.cn/; } - } - - server { - listen 443 ssl; - server_name contexts.com.cn; - - ssl_certificate 7424713_contexts.com.cn.pem; - ssl_certificate_key 7424713_contexts.com.cn.key; - - include location.conf; - } - server { listen 80; server_name shylinux.com; location / { - include headers.conf; + include header.conf; if ($http_user_agent ~* "^Wget") { proxy_pass http://127.0.0.1:9020; break; @@ -59,8 +27,8 @@ http { listen 443 ssl; server_name shylinux.com; - ssl_certificate 6157098_shylinux.com.pem; - ssl_certificate_key 6157098_shylinux.com.key; + ssl_certificate_key 8293704_shylinux.com.key; + ssl_certificate 8293704_shylinux.com.pem; include location.conf; } diff --git a/etc/miss.sh b/etc/miss.sh index 5caf995f..42c8155a 100644 --- a/etc/miss.sh +++ b/etc/miss.sh @@ -36,7 +36,7 @@ ish_miss_make; if [ -n "$*" ]; then ./bin/ice.bin forever serve "$@"; fi ish_sys_link_create ~/.vim_local.vim $PWD/etc/conf/vim_local.vim require dev/vim/vim.sh -ish_dev_vim_prepare +# ish_dev_vim_prepare if tmux -V; then require dev/tmux/tmux.sh diff --git a/go.mod b/go.mod index 849ab12a..bd336715 100644 --- a/go.mod +++ b/go.mod @@ -15,3 +15,17 @@ require ( shylinux.com/x/icebergs v1.3.3 shylinux.com/x/toolkits v0.6.7 ) + +replace ( + shylinux.com/x/ice => ./usr/release + shylinux.com/x/icebergs => ./usr/icebergs + shylinux.com/x/toolkits => ./usr/toolkits +) + +replace ( + shylinux.com/x/golang-story => ./usr/golang-story + shylinux.com/x/linux-story => ./usr/linux-story + shylinux.com/x/mysql-story => ./usr/mysql-story + shylinux.com/x/nginx-story => ./usr/nginx-story + shylinux.com/x/redis-story => ./usr/redis-story +) diff --git a/go.sum b/go.sum index c5db2463..5ac7de50 100644 --- a/go.sum +++ b/go.sum @@ -4,20 +4,5 @@ shylinux.com/x/go-qrcode v0.0.1 h1:/eOGqMj1qtgs9Ymd12zTUa1gcJZs9S92kj2lb0QzKsE= shylinux.com/x/go-qrcode v0.0.1/go.mod h1:KAbtU+KwiiABMZ/CJ0zh9PI2AX82Uf9rRYcQ4ODm4po= shylinux.com/x/go-sql-mysql v0.0.1 h1:VX5SrwLBKzfkRouj39LgJ9reIXOWmMsScRpr+e0qdp0= shylinux.com/x/go-sql-mysql v0.0.1/go.mod h1:47OfAZK24HRJMy7dAu/jrksGCf9yzJaAUFwWYjhDFDA= -shylinux.com/x/golang-story v0.4.7 h1:nqN6JAAszO6Jbin6qEnwOTt7qSH0ljrLAvCbDrHHCRQ= -shylinux.com/x/golang-story v0.4.7/go.mod h1:Itpd4Auan1LYwAY40Rkb1cEUFReJ/711b3qbR30cJH0= -shylinux.com/x/ice v1.0.8 h1:PSbA4Vqs7ZL8OCOTjEVoHPYwwQYPOu1YBsX+HwPAz98= -shylinux.com/x/ice v1.0.8/go.mod h1:m1r5vrBF9WRileC+vCZqZxS1lAtO0ISlDC/coNcnDBg= -shylinux.com/x/icebergs v1.3.3 h1:P5LUAf1ivT0kIueIj8MsjV/uF0705u2ig/4bRrLS6XI= -shylinux.com/x/icebergs v1.3.3/go.mod h1:4RlyPPPE2Ao54peovChY8hYK5bXNpBRwIw1YZKOZWk8= -shylinux.com/x/linux-story v0.4.5/go.mod h1:G9JYEfxGDpsjX28rTgDfoBUzZQC+wPcdAkLtiPC7EsU= -shylinux.com/x/mysql-story v0.4.8 h1:hQDtDEWhEJloInGazgoQFckHuWawn8PxWQQLIs+RCnA= -shylinux.com/x/mysql-story v0.4.8/go.mod h1:qK3mvn+s6i81nYNG16QV3CqFZZ09+c5T0vQDjSkoC2E= -shylinux.com/x/nginx-story v0.4.8 h1:QSx928tUdHXJKC7I6CR5SreNayprDYv4BxA7ETz95G4= -shylinux.com/x/nginx-story v0.4.8/go.mod h1:WirYm33lKIs99At2nzSaiWWzuzjrhWdPx4sGi18r/vE= -shylinux.com/x/redis-story v0.4.9 h1:X2wVMDRoqiM9Gc8GYQr8sR11Wea+z45l8CQGQo3Nk3Q= -shylinux.com/x/redis-story v0.4.9/go.mod h1:MOzt0jhewLdaioZ+itJcWc0KSCmwvGVX+97Q63rC+Nw= -shylinux.com/x/toolkits v0.6.7 h1:d9xN4ClsVt0qTWGJT7tt1RWHcS5yiJqurUHGpY93cRI= -shylinux.com/x/toolkits v0.6.7/go.mod h1:8LbYHe7oxBIqb6s4MSOD+4d28QvPdvkyCVtwB/JW7AA= shylinux.com/x/websocket v0.0.1 h1:OBc21DxqsGlQ2+Pz76xqLyDNo1LV+PUUqfWi+1PZPDE= shylinux.com/x/websocket v0.0.1/go.mod h1:AaSpMToOxbMULKQytzczeHPuqb708vK1vrAzCxLo/XE=