Linux 常用工具
YUM
yum init system
create local repo yum
centos 7 init system
FTP
How to Install and Configure vsftpd on CentOS 6
vsftp install on centos 7
Email
aliyun ecs install email
postfix smtp on centos
centos 6 postfix smpt test
GIT
gogs install centos6
git command example
git format markdown
HTTP Web
apache exampe
h5ai web php file server
apache vhosgts code debug
Nginx Web
nginx install from source
nginx set directory autoindex
autoindex with h5ai web
nginx install pugin ngx-fancyindex
proxy internal vhost to web
dynamic and static by nginx
proxy directory second by nginx
nginx proxy gogs web
jenkns proxy from nginx
ssl certify by nginx
nginx threads fix to 9x
NTP
linux install ntp use asia date
VNC
vnc remote desktop
x11vnc on centos6
Firewall
iptables on centos 7
centos7 firewalld config
Kernel
centos kernel packages
kernel update to 3.10 on centos 6
SYSCTL 内核配置参数分析
NFS
centos6 install nfs servers
mount nfs to linux
mount nfs on centos 6
centos6 nfs verify permissions
SSH
ssh keygen rsa to client
ssh config diffent
Network
centos 7 config net-tool debug ifconfig
debug network card up or down
Samba
samba install on centos 6
samba config example
VIM
VIM using example
本文档使用 MrDoc 发布
-
+
首页
proxy directory second by nginx
# proxy directory second by nginx --- ## add vhost # vim /yourhttpdirctory/nginx/conf.d/test.conf ```python # ####################################### # server { listen 8888; server_name 172.31.42.202; location / { proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://172.31.42.222:80/wordpress/; } location /wordpress/ { proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://172.31.42.222:80/wordpress/; } error_page 500 502 503 504 /50x.html; access_log logs/172.31.42.222_80_access.log; } # ####################################### # ``` ## test # nginx -t 测试nginx 反向代理是否有错误。如无开启。 访问主页的二级目录页面。 To: http://10.88.23.66:8888/wordpress/ # nginx -v --- ```python nginx version: nginx/1.10.2 upstream iso { server 172.31.42.222 max_fails=3 fail_timeout=30s; } upstream clone { server 172.31.42.222 max_fails=3 fail_timeout=30s; } upstream profile_git { server 172.31.42.231:3000 max_fails=3 fail_timeout=30s; } server { # ################################## location /iso { proxy_pass http://iso; port_in_redirect off; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } # ################################## location /clone { proxy_pass http://clone; } # ################################## location /profile/ { proxy_pass http://profile_git/; proxy_set_header Host $host:$server_port; proxy_redirect http://profile_git/ http://$host:$server_port/profile/; client_max_body_size 50M; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; sub_filter 'href="/' 'href="/profile/'; sub_filter 'src="/' 'src="/profile/'; sub_filter_once off; } gogs url set http://sdfdfd:8080/profile/ location /profile/ { proxy_pass http://profile_server/; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Frame-Options SAMEORIGIN; } location /profile/ { proxy_pass http://profile_git/; proxy_set_header Host $host:$server_port; proxy_redirect http://profile_git/ http://$host:$server_port/profile/; client_max_body_size 50M; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # sub_filter 'href="/' 'href="/profile/'; # sub_filter 'src="/' 'src="/profile/'; # sub_filter_once off; } } https://wiki.jenkins.io/display/JENKINS/Jenkins+behind+an+NGinX+reverse+proxy server { listen 80; server_name jenkins.domain.tld; return 301 https://$host$request_uri; } server { listen 80; server_name jenkins.domain.tld; location / { proxy_set_header Host $host:$server_port; 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; # Fix the "It appears that your reverse proxy set up is broken" error. proxy_pass http://127.0.0.1:8080; proxy_read_timeout 90; proxy_redirect http://127.0.0.1:8080 https://jenkins.domain.tld; # Required for new HTTP-based CLI proxy_http_version 1.1; proxy_request_buffering off; # workaround for https://issues.jenkins-ci.org/browse/JENKINS-45651 add_header 'X-SSH-Endpoint' 'jenkins.domain.tld:50022' always; } } jenkins url set http://sdfdfd/jenkins/ location /jenkins { proxy_pass http://jenkins_server/jenkins/; #proxy_pass http://172.31.42.230/jenkins/; #proxy_pass http://172.31.42.230:8080/task/; proxy_set_header Host $host:$http_host; 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_max_temp_file_size 0; #this is the maximum upload size client_max_body_size 60m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; } ``` done
Bobby
2021年12月20日 23:19
分享文档
收藏文档
阅读
135
上一篇
下一篇
微信扫一扫
复制链接
手机扫一扫进行分享
复制链接
关于 MrDoc
觅思文档MrDoc
是
州的先生
开发并开源的在线文档系统,其适合作为个人和小型团队的云笔记、文档和知识库管理工具。
如果觅思文档给你或你的团队带来了帮助,欢迎对作者进行一些打赏捐助,这将有力支持作者持续投入精力更新和维护觅思文档,感谢你的捐助!
>>>捐助鸣谢列表
微信
支付宝
QQ
PayPal
Markdown文件
分享
链接
类型
密码
更新密码