德勤https 443端口配置
来自ling
网站转换
有个网站能直接做这个事情,当时做wiki的https和nas的时候还用了,但具体哪里忘记了,待完善!!!! https://csr.chinassl.net/convert-ssl.html 找了一个但没有尝试!!!
pfx证书转换
下载百度云 来自PC的备份文...>工作>德勤>TR中的文件
解压openssl到C:\openssl-1.0.2,并将nasm.exe和ndisasm.exe放在C:\openssl-1.0.2
使用VS2015 x86 Native Tools Command Prompt或developer command ....运行
cd C:\openssl-1.0.2 perl Configure VC-WIN32 --prefix=C:\openssl-1.0.2\ ms\do_nasm nmake -f ms\ntdll.mak
或直接下载编译好内容openssl-1.0.2.rar
将C:\openssl-1.0.2\out32dll添加到window环境变量的path下,使cmd中能使用openssl命令
openssl pkcs12 -in C:\openssl-1.0.2\out32dll\CCT.pfx -out C:\openssl-1.0.2\out32dll\CCT.pem -nodes openssl pkcs12 -in C:\openssl-1.0.2\out32dll\CCT.pfx -nocerts -nodes -out C:\openssl-1.0.2\out32dll\CCT.key openssl pkcs12 -in C:\openssl-1.0.2\out32dll\CCT.pfx -nodes -nokeys -passin pass:Dtt#1234 -out C:\openssl-1.0.2\out32dll\CCT.cer
openssl pkcs12 -in C:\openssl-1.0.2\out32dll\tpems.pfx -out C:\openssl-1.0.2\out32dll\tpems.pem -nodes openssl pkcs12 -in C:\openssl-1.0.2\out32dll\tpems.pfx -nocerts -nodes -out C:\openssl-1.0.2\out32dll\tpems.key openssl pkcs12 -in C:\openssl-1.0.2\out32dll\tpems.pfx -nodes -nokeys -passin pass:Dtt#1234 -out C:\openssl-1.0.2\out32dll\tpems.cer
<Connector port="8703" protocol="org.apache.coyote.http11.Http11AprProtocol"
maxThreads="200"
scheme="https" secure="true" SSLEnabled="true"
SSLProtocol="TLSv1+TLSv1.1+TLSv1.2"
SSLCertificateKeyFile="D:\server\tomcat7_64\conf\CCT.pem"
SSLCertificateFile="D:\server\tomcat7_64\conf\CCT.cer"/>
tomcat配置
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Note: A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" at this level.
Documentation at /docs/config/server.html
-->
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener" />
<!-- Security listener. Documentation at /docs/config/listeners.html
<Listener className="org.apache.catalina.security.SecurityListener" />
-->
<!--APR library loader. Documentation at /docs/apr.html -->
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<!-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
-->
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
<!-- A "Service" is a collection of one or more "Connectors" that share
a single "Container" Note: A "Service" is not itself a "Container",
so you may not define subcomponents such as "Valves" at this level.
Documentation at /docs/config/service.html
-->
<Service name="Catalina">
<!--The connectors can use a shared executor, you can define one or more named thread pools-->
<!--
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
maxThreads="150" minSpareThreads="4"/>
-->
<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Documentation at :
Java HTTP Connector: /docs/config/http.html
Java AJP Connector: /docs/config/ajp.html
APR (HTTP/AJP) Connector: /docs/apr.html
Define a non-SSL/TLS HTTP/1.1 Connector on port 8080
-->
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="443" />
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="443" />
-->
<!-- Define a SSL/TLS HTTP/1.1 Connector on port 443
This connector uses the NIO implementation with the JSSE engine. When
using the JSSE engine, the JSSE configuration attributes must be used.
-->
<!--
<Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true">
<SSLHostConfig>
<Certificate certificateKeystoreFile="conf/localhost-rsa.jks"
type="RSA" />
</SSLHostConfig>
</Connector>
-->
<!-- Define a SSL/TLS HTTP/1.1 Connector on port 443 with HTTP/2
This connector uses the APR/native implementation. When using the
APR/native implementation or the OpenSSL engine with NIO or NIO2 then
the OpenSSL configuration attributes must be used.
-->
<Connector port="443" protocol="org.apache.coyote.http11.Http11AprProtocol"
maxThreads="150" SSLEnabled="true" >
<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
<SSLHostConfig>
<Certificate certificateKeyFile="conf/drtax.key"
certificateFile="conf/drtax.pem"
type="RSA" />
</SSLHostConfig>
</Connector>
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="443" />
<!-- An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host).
Documentation at /docs/config/engine.html -->
<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
-->
<Engine name="Catalina" defaultHost="localhost">
<!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation) -->
<!--
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
-->
<!-- Use the LockOutRealm to prevent attempts to guess user passwords
via a brute-force attack -->
<Realm className="org.apache.catalina.realm.LockOutRealm">
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Context path="" docBase="F:/Report/tr/war/TR_201_job" debug="0" useHttpOnly="true">
</Context>
<Context path="/train" docBase="F:/Report/tr/war/TR_201_test_job" debug="0" useHttpOnly="true">
</Context>
<Context path="/ges" docBase="F:/Report/tr/war/trges_job" debug="0" useHttpOnly="true">
</Context><!---->
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
</Engine>
</Service>
</Server>
ges tr
worker_processes 30;
error_log C:/server/logs/nginx/error.log;
events {
worker_connections 65535;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
upstream tr{
ip_hash;
server 10.172.128.201:8080 weight=2 max_fails=1 fail_timeout=90s;
server 10.172.128.201:8082 weight=5 max_fails=1 fail_timeout=90s;
#server 10.172.128.201:8083 weight=3 max_fails=1 fail_timeout=90s;
#server 10.172.128.201:8084 weight=3 max_fails=1 fail_timeout=90s;
#server 10.172.128.203:8080 weight=1 max_fails=1 fail_timeout=90s;
#server 10.172.128.203:8081 weight=5 max_fails=1 fail_timeout=90s;
#keepalive 20;
}
upstream tr_gat{
ip_hash;
server 10.172.128.201:8083 weight=3 max_fails=1 fail_timeout=90s;
server 10.172.128.201:8084 weight=3 max_fails=1 fail_timeout=90s;
#keepalive 20;
}
upstream tr_west{
ip_hash;
server 10.172.128.201:8085 weight=3 max_fails=1 fail_timeout=90s;
server 10.172.128.201:8086 weight=3 max_fails=1 fail_timeout=90s;
#keepalive 20;
}
upstream tr_south{
ip_hash;
server 10.172.128.201:8087 weight=3 max_fails=1 fail_timeout=90s;
server 10.172.128.201:8088 weight=3 max_fails=1 fail_timeout=90s;
#keepalive 20;
}
upstream tr_north{
ip_hash;
server 10.172.128.201:8089 weight=3 max_fails=1 fail_timeout=90s;
server 10.172.128.201:8090 weight=3 max_fails=1 fail_timeout=90s;
#keepalive 20;
}
upstream tr_train{
server 10.172.128.201:8079;
}
upstream tr_exer{
server 10.172.128.201:8091;
}
upstream ges{
server 10.172.128.201:8078 weight=2 max_fails=1 fail_timeout=90s;
#server 10.172.128.201:8082 weight=5 max_fails=1 fail_timeout=90s;
#server 10.172.128.201:8083 weight=3 max_fails=1 fail_timeout=90s;
#server 10.172.128.201:8084 weight=3 max_fails=1 fail_timeout=90s;
#server 10.172.128.203:8080 weight=1 max_fails=1 fail_timeout=90s;
#server 10.172.128.203:8081 weight=5 max_fails=1 fail_timeout=90s;
#keepalive 20;
}
server {
listen 80;
rewrite ^(.*)$ https://$host$1 permanent;
}
server {
listen 443 ssl;
ssl_certificate C:\\server\\nginx\\conf\\drtax.pem;
ssl_certificate_key C:\\server\\nginx\\conf\\drtax.key;
#ssl_session_cache shared:SSL:1m;
#ssl_session_timeout 5m;
#ssl_ciphers HIGH:!aNULL:!MD5;
#ssl_prefer_server_ciphers on;
charset utf-8;
location /tr_gat{
proxy_pass http://tr_gat;
proxy_http_version 1.1;
proxy_set_header Connection "";
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_connect_timeout 2;
client_max_body_size 1000m;
}
location /tr_west{
proxy_pass http://tr_west;
proxy_http_version 1.1;
proxy_set_header Connection "";
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_connect_timeout 2;
client_max_body_size 1000m;
}
location /tr_south{
proxy_pass http://tr_south;
proxy_http_version 1.1;
proxy_set_header Connection "";
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_connect_timeout 2;
client_max_body_size 1000m;
}
location /tr_north{
proxy_pass http://tr_north;
proxy_http_version 1.1;
proxy_set_header Connection "";
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_connect_timeout 2;
client_max_body_size 1000m;
}
location /train{
proxy_pass http://tr_train;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 1000m;
}
location /exer{
proxy_pass http://tr_exer;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 1000m;
}
location /{
proxy_pass http://tr;
proxy_http_version 1.1;
proxy_set_header Connection "";
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_connect_timeout 2;
client_max_body_size 1000m;
}
}
#ges server
server {
listen 443 ssl;
server_name ges.deloitte.com.cn;
ssl_certificate C:\\server\\nginx\\conf\\ges.pem;
ssl_certificate_key C:\\server\\nginx\\conf\\ges.key;
charset utf-8;
location /{
proxy_pass http://ges;
proxy_http_version 1.1;
proxy_set_header Connection "";
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_connect_timeout 2;
client_max_body_size 1000m;
}
}
}
old barkup
#user nobody;
worker_processes 2;
error_log d:/server/logs/nginx/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
upstream tr{
ip_hash;
server 10.172.128.201:8080 weight=1 max_fails=1 fail_timeout=90s;
#server 10.172.128.201:8081 weight=1 max_fails=1 fail_timeout=90s;
#server 10.172.128.202:8080 weight=1 max_fails=1 fail_timeout=90s;
#server 10.172.128.202:8081 weight=1 max_fails=1 fail_timeout=90s;
#keepalive 20;
}
server {
listen 80;
rewrite ^(.*)$ https://$host$1 permanent;
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
server {
listen 443 ssl;
server_name localhost;
ssl_certificate C:\\server\\nginx\\conf\\drtax.pem;
ssl_certificate_key C:\\server\\nginx\\conf\\drtax.key;
#ssl_session_cache shared:SSL:1m;
#ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
charset utf-8;
location /{
proxy_pass http://tr;
proxy_http_version 1.1; proxy_set_header Connection ""; 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_connect_timeout 2;
client_max_body_size 1000m;
}
location /videoroot/ {
alias C:\\upload\\UploadVideo\\;
}
}
}