86 lines
2.9 KiB
Nginx Configuration File
86 lines
2.9 KiB
Nginx Configuration File
|
|
user root;
|
|
worker_processes 1;
|
|
|
|
#error_log logs/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;
|
|
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|
# '$status $body_bytes_sent "$http_referer" '
|
|
# '"$http_user_agent" "$http_x_forwarded_for"';
|
|
|
|
#access_log logs/access.log main;
|
|
sendfile on;
|
|
#tcp_nopush on;
|
|
#keepalive_timeout 0;
|
|
keepalive_timeout 65;
|
|
underscores_in_headers on;
|
|
client_max_body_size 1024M;
|
|
gzip on;
|
|
send_timeout 60;
|
|
server_tokens off;
|
|
server{
|
|
listen 443 ssl; # 1.1版本后这样写
|
|
server_name sanfengyulin.cbsd-pro.com; #填写绑定证书的域名
|
|
ssl_certificate /opt/cloud_ca/sanfengyulin.cbsd-pro.com.pem; # 指定证书的位置,绝对路径
|
|
ssl_certificate_key /opt/cloud_ca/sanfengyulin.cbsd-pro.com.key; # 绝对路径,同上
|
|
ssl_session_timeout 5m;
|
|
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #按照这个协议配置
|
|
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;#按照这个套件配置
|
|
ssl_prefer_server_ciphers on;
|
|
add_header Referrer-Policy "no-referrer" always; ##解决不同源跨域问题
|
|
add_header X-Frame-Options SAMEORIGIN;
|
|
add_header X-Permitted-Cross-Domain-Policies 'none';
|
|
add_header X-Download-Options "noopen";
|
|
location / {
|
|
root /opt/nodeweb/dist/;
|
|
index index.html index.htm;
|
|
}
|
|
location /universaltestsoftware_client_api {
|
|
proxy_pass http://sanfengyulinapi:8585/universaltestsoftware_client_api/;
|
|
}
|
|
}
|
|
server {
|
|
listen 80;
|
|
server_name sanfengyulin.cbsd-pro.com;
|
|
client_max_body_size 200m;
|
|
add_header Content-Security-Policy "default-src * data: 'unsafe-inline' 'unsafe-eval';";
|
|
add_header X-XSS-Protection "1; mode=block";
|
|
add_header X-Content-Type-Options nosniff;
|
|
add_header Referrer-Policy "no-referrer" always; ##解决不同源跨域问题
|
|
add_header X-Frame-Options SAMEORIGIN;
|
|
add_header X-Permitted-Cross-Domain-Policies 'none';
|
|
add_header X-Download-Options "noopen";
|
|
|
|
location / {
|
|
root /opt/nodeweb/dist/;
|
|
index index.html index.htm;
|
|
}
|
|
location /universaltestsoftware_client_api {
|
|
proxy_pass http://sanfengyulinapi:8585/universaltestsoftware_client_api/;
|
|
}
|
|
|
|
#error_page 404 /404.html;
|
|
|
|
# redirect server error pages to the static page /50x.html
|
|
#
|
|
# error_page 500 502 503 504 /50x.html;
|
|
error_page 404 403 500 502 503 504 /404.html;
|
|
location = /50x.html {
|
|
root html;
|
|
}
|
|
|
|
}
|
|
}
|