1
0

faet: omc在docker服务中配置

This commit is contained in:
TsMask
2024-11-01 16:46:34 +08:00
parent 07b78e1138
commit eac9b2b4e9
8 changed files with 244 additions and 169 deletions

View File

@@ -48,7 +48,7 @@ http {
# Path of the file with Diffie-Hellman parameters for EDH ciphers.
# TIP: Generate with: `openssl dhparam -out /etc/ssl/nginx/dh2048.pem 2048`
ssl_dhparam /usr/local/omc/nginx/cert/dhparams.pem;
ssl_dhparam /etc/nginx/cert/dhparams.pem;
# Specifies that our cipher suits should be preferred over client ciphers.
# Default is 'off'.
@@ -95,12 +95,39 @@ http {
listen 80;
listen [::]:80;
server_name localhost;
# 修改允许最大请求体大小为100MB
client_max_body_size 100M;
# 持久连接的超时时间默认60s
keepalive_timeout 180s;
#access_log /var/log/nginx/host.access.log main;
# ssl_certificate /usr/share/nginx/cert/www.x.cn_chain.crt;
# ssl_certificate_key /usr/share/nginx/cert/www.x.cn.key;
# ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
# ssl_session_timeout 5m;
# ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
# ssl_prefer_server_ciphers on;
# ssl_dhparam /usr/share/nginx/cert/dhparams.pem;
# OMC
location / {
root /usr/local/etc/omc/frontend;
try_files $uri $uri/ /index.html;
index index.html index.htm;
}
location /omc-api/ {
proxy_pass http://127.0.0.1:3030/;
proxy_http_version 1.1;
proxy_cache_bypass $http_upgrade;
proxy_pass http://127.0.0.1:33030/;
proxy_connect_timeout 180s; # 默认60s
proxy_send_timeout 180s; # 默认60s
proxy_read_timeout 180s; # 默认60s
proxy_cache_bypass $http_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
@@ -111,11 +138,30 @@ http {
proxy_set_header X-Forwarded-Port $server_port;
}
location / {
root /usr/local/bin/omc-frontend;
location /api/rest/ {
# 添加斜杠并重定向
#rewrite ^([^.]*[^/])$ $1/ permanent;
proxy_pass http://127.0.0.1:33030/api/rest/;
try_files $uri $uri/ /index.html;
index index.html index.htm;
proxy_cache_bypass $http_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
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 $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/local/etc/omc/frontend;
}
}
}