SlideShare a Scribd company logo
** 证书位置
crt /ca/server.crt;
key /ca/server.key;
# Server 80 表示http,通过httpstatus 301 强制跳转⾄至https
server {
listen 80 ;
server_name xxx.zgxcw.com;
location / {
return 301 https://$host$request_uri;
}
error_page 404 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
server {
listen 443 ;
server_name xxx.zgxcw.com;
access_log logs/xxx443.zgxcw.com.log access ;
error_log logs/xxx443.zgxcw.com_error.log;
ssl on;
ssl_certificate /ca/server.crt;
ssl_certificate_key /ca/server.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EX
P;
ssl_prefer_server_ciphers on;
location / {
proxy_pass http://tom_xxx ;
proxy_set_header X-Forwarded-Proto https;
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-Forwarded-Proto https;
}
error_page 404 500 502 503 504 /50x.html;
location = /50x.html {
nginx+tomcat https 配置
nginx https配置
root html;
}
nginx 配置ssl之后,会发现tomcat 接收到请求依然是http,然后在
sendRedircet,getSchame⽅方法中获取的schame依然是http,或导致应⽤用程序会有莫名错误
tomcat 安装⽬目录下 conf/server.xml 新增 org.apache.catalina.valves.RemoteIpValve 节点
nginxip1|nginxip2 是nginx服务器器的ip
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Valve className="org.apache.catalina.valves.RemoteIpValve"
internalProxies="nginxip1|nginxip2"
remoteIpHeader="x-forwarded-for"
protocolHeader="x-forwarded-proto"
protocolHeaderHttpsValue="https"
/>
<Valve className="org.apache.catalina.valves.AccessLogValve" directo
ry="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t &quot;%r&quot; %s %b" />
</Host>
</Engine>
jira安装⽬目录 conf/server.xml Engine节点下新增如下节点
<Valve className="org.apache.catalina.valves.RemoteIpValve"
internalProxies="nginxip"
remoteIpHeader="x-forwarded-for"
protocolHeader="x-forwarded-proto"
protocolHeaderHttpsValue="https"
/>
tomcat 配置
jira 升级https配置
Nginx+tomcat  https 配置

More Related Content

PDF
SSH: Seguranca no Acesso Remoto
PPTX
Ansible ssh y comandos ad-hoc
PDF
Relayd: a load balancer for OpenBSD
PDF
OWASP Proxy
PDF
Pf: the OpenBSD packet filter
PPTX
Monero Presentation by Justin Ehrenhofer - Athens, Greece 2017
PPTX
PDF
HTTPS, Here and Now
SSH: Seguranca no Acesso Remoto
Ansible ssh y comandos ad-hoc
Relayd: a load balancer for OpenBSD
OWASP Proxy
Pf: the OpenBSD packet filter
Monero Presentation by Justin Ehrenhofer - Athens, Greece 2017
HTTPS, Here and Now

What's hot (20)

DOCX
DOC
Setting ubuntu server sebagai pc router
PDF
Fail2ban - the system security for green hand -on linux os
ODP
FreeLix: Semplicità & Controllo
PDF
Importance of SSHFP for Network Devices
PDF
Importance of sshfp and configuring sshfp for network devices
DOCX
Securing the tunnel with Raccoon
PDF
Advanced open ssh
PDF
Mise en place d'un client VPN l2tp IPsec sous docker
PPTX
Configuring ssh on switch
PPTX
Web sockets
PDF
Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018
PDF
Oracle http server installation on linux
PDF
Reverse engineering Swisscom's Centro Grande Modem
PDF
Hacking Exposed LIVE: Attacking in the Shadows
PDF
ハイパフォーマンスブラウザネットワーキング2
PPTX
Netmiko library
PDF
Pledge in OpenBSD
TXT
PDF
PFIセミナー資料 H27.10.22
Setting ubuntu server sebagai pc router
Fail2ban - the system security for green hand -on linux os
FreeLix: Semplicità & Controllo
Importance of SSHFP for Network Devices
Importance of sshfp and configuring sshfp for network devices
Securing the tunnel with Raccoon
Advanced open ssh
Mise en place d'un client VPN l2tp IPsec sous docker
Configuring ssh on switch
Web sockets
Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018
Oracle http server installation on linux
Reverse engineering Swisscom's Centro Grande Modem
Hacking Exposed LIVE: Attacking in the Shadows
ハイパフォーマンスブラウザネットワーキング2
Netmiko library
Pledge in OpenBSD
PFIセミナー資料 H27.10.22
Ad

Viewers also liked (20)

PPT
Lock Interface in Java
PDF
Java多线程技术
PDF
App开发过程的演变之路
PDF
PDF
大型网站架构演变
PDF
自己的JVM自己救: 解救 OOM 實務經驗談 (JCConf 2015)
PPT
Recipe 黃佳伶 葉愛慧
PDF
Save JVM by Yourself: Real War Experiences of OOM
PDF
如何更好地设计测试用例-BQConf
ODP
Building a lock profiler on the JVM
PDF
浅谈项目管理(诸葛B2B电商研发部版改)
PPTX
Thrift+scribe实现分布式日志收集,并与log4j集成
PDF
Performance Tuning - Understanding Garbage Collection
PDF
Concurrency: Best Practices
PDF
[Java concurrency]02.basic thread synchronization
PDF
JVM及其调优
PPTX
Java concurrency - Thread pools
PDF
淺談 Java GC 原理、調教和 新發展
PDF
On heap cache vs off-heap cache
PDF
Introduction of Java GC Tuning and Java Java Mission Control
Lock Interface in Java
Java多线程技术
App开发过程的演变之路
大型网站架构演变
自己的JVM自己救: 解救 OOM 實務經驗談 (JCConf 2015)
Recipe 黃佳伶 葉愛慧
Save JVM by Yourself: Real War Experiences of OOM
如何更好地设计测试用例-BQConf
Building a lock profiler on the JVM
浅谈项目管理(诸葛B2B电商研发部版改)
Thrift+scribe实现分布式日志收集,并与log4j集成
Performance Tuning - Understanding Garbage Collection
Concurrency: Best Practices
[Java concurrency]02.basic thread synchronization
JVM及其调优
Java concurrency - Thread pools
淺談 Java GC 原理、調教和 新發展
On heap cache vs off-heap cache
Introduction of Java GC Tuning and Java Java Mission Control
Ad

Similar to Nginx+tomcat https 配置 (20)

PDF
Nginx - The webserver you might actually like
PDF
install nginx SSL.pdf
PPTX
OWASP San Diego Training Presentation
PDF
Configuring SSL on NGNINX and less tricky servers
PDF
Vladimir Vorontsov - Splitting, smuggling and cache poisoning come back
PPTX
Deployment Patterns of WSO2 Identity Server
PDF
Secure Communications with VisualWorks - CSTUC 2006
PDF
Raconte-moi X.509 : anatomie d'une autorité de certification
PPTX
NGINX: High Performance Load Balancing
PPTX
Angular js security
PDF
10 Excellent Ways to Secure Your Spring Boot Application - Devoxx Belgium 2019
PPTX
REST API Security: OAuth 2.0, JWTs, and More!
PPTX
Demystifying REST
PPT
PDF
FIWARE Wednesday Webinars - How to Secure IoT Devices
PDF
honeyTLS - Profiling and Clustering Internet-wide SSL/TLS Scans with JA3
PDF
Sinn und Unsinn von SSL
PPTX
NGINX: High Performance Load Balancing
PDF
Introduction to Traefik
PDF
DockerCon Live 2020 - Securing Your Containerized Application with NGINX
Nginx - The webserver you might actually like
install nginx SSL.pdf
OWASP San Diego Training Presentation
Configuring SSL on NGNINX and less tricky servers
Vladimir Vorontsov - Splitting, smuggling and cache poisoning come back
Deployment Patterns of WSO2 Identity Server
Secure Communications with VisualWorks - CSTUC 2006
Raconte-moi X.509 : anatomie d'une autorité de certification
NGINX: High Performance Load Balancing
Angular js security
10 Excellent Ways to Secure Your Spring Boot Application - Devoxx Belgium 2019
REST API Security: OAuth 2.0, JWTs, and More!
Demystifying REST
FIWARE Wednesday Webinars - How to Secure IoT Devices
honeyTLS - Profiling and Clustering Internet-wide SSL/TLS Scans with JA3
Sinn und Unsinn von SSL
NGINX: High Performance Load Balancing
Introduction to Traefik
DockerCon Live 2020 - Securing Your Containerized Application with NGINX

More from 诸葛修车网-诸葛商城 (7)

PPT
组合、备忘录、建造者模式、原型
PDF
设计模式-单例、享元、工厂与抽象工厂
PPTX
面向对象设计原则
PDF
单元测试(Unit Test)- Spock应用
PPTX
Maven技术及诸葛商城应用(1)
PPTX
Push-推送技术
PDF
Sonar java -Write Clean Code,Detect Bugs
组合、备忘录、建造者模式、原型
设计模式-单例、享元、工厂与抽象工厂
面向对象设计原则
单元测试(Unit Test)- Spock应用
Maven技术及诸葛商城应用(1)
Push-推送技术
Sonar java -Write Clean Code,Detect Bugs

Recently uploaded (20)

PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Nekopoi APK 2025 free lastest update
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
L1 - Introduction to python Backend.pptx
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
System and Network Administration Chapter 2
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
System and Network Administraation Chapter 3
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
history of c programming in notes for students .pptx
PPTX
Transform Your Business with a Software ERP System
PDF
Digital Strategies for Manufacturing Companies
How to Migrate SBCGlobal Email to Yahoo Easily
Reimagine Home Health with the Power of Agentic AI​
CHAPTER 2 - PM Management and IT Context
Design an Analysis of Algorithms I-SECS-1021-03
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Nekopoi APK 2025 free lastest update
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Wondershare Filmora 15 Crack With Activation Key [2025
L1 - Introduction to python Backend.pptx
VVF-Customer-Presentation2025-Ver1.9.pptx
System and Network Administration Chapter 2
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
System and Network Administraation Chapter 3
Odoo POS Development Services by CandidRoot Solutions
How to Choose the Right IT Partner for Your Business in Malaysia
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Odoo Companies in India – Driving Business Transformation.pdf
history of c programming in notes for students .pptx
Transform Your Business with a Software ERP System
Digital Strategies for Manufacturing Companies

Nginx+tomcat https 配置

  • 1. ** 证书位置 crt /ca/server.crt; key /ca/server.key; # Server 80 表示http,通过httpstatus 301 强制跳转⾄至https server { listen 80 ; server_name xxx.zgxcw.com; location / { return 301 https://$host$request_uri; } error_page 404 500 502 503 504 /50x.html; location = /50x.html { root html; } } server { listen 443 ; server_name xxx.zgxcw.com; access_log logs/xxx443.zgxcw.com.log access ; error_log logs/xxx443.zgxcw.com_error.log; ssl on; ssl_certificate /ca/server.crt; ssl_certificate_key /ca/server.key; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EX P; ssl_prefer_server_ciphers on; location / { proxy_pass http://tom_xxx ; proxy_set_header X-Forwarded-Proto https; 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-Forwarded-Proto https; } error_page 404 500 502 503 504 /50x.html; location = /50x.html { nginx+tomcat https 配置 nginx https配置
  • 2. root html; } nginx 配置ssl之后,会发现tomcat 接收到请求依然是http,然后在 sendRedircet,getSchame⽅方法中获取的schame依然是http,或导致应⽤用程序会有莫名错误 tomcat 安装⽬目录下 conf/server.xml 新增 org.apache.catalina.valves.RemoteIpValve 节点 nginxip1|nginxip2 是nginx服务器器的ip <Engine name="Catalina" defaultHost="localhost"> <Realm className="org.apache.catalina.realm.LockOutRealm"> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> </Realm> <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"> <Valve className="org.apache.catalina.valves.RemoteIpValve" internalProxies="nginxip1|nginxip2" remoteIpHeader="x-forwarded-for" protocolHeader="x-forwarded-proto" protocolHeaderHttpsValue="https" /> <Valve className="org.apache.catalina.valves.AccessLogValve" directo ry="logs" prefix="localhost_access_log." suffix=".txt" pattern="%h %l %u %t &quot;%r&quot; %s %b" /> </Host> </Engine> jira安装⽬目录 conf/server.xml Engine节点下新增如下节点 <Valve className="org.apache.catalina.valves.RemoteIpValve" internalProxies="nginxip" remoteIpHeader="x-forwarded-for" protocolHeader="x-forwarded-proto" protocolHeaderHttpsValue="https" /> tomcat 配置 jira 升级https配置