1
0

feat: 更新为ubuntu22.04版本容器

This commit is contained in:
TsMask
2024-11-01 20:53:37 +08:00
parent d41ea50bd0
commit 1db5713183
5 changed files with 86 additions and 103 deletions

View File

@@ -0,0 +1 @@
aNHIGgEM8peJlhuQr1jjoTww/bap9p8cdnEpbPlX0LvvYDLw1X6tqNxeN0QyGdSQHRkpiS7jw2eFiuWsB7sPewohAq2nZgqyYcbg88pjViM72CkCrv0mQ+Ia0ir/FN5zjG0KCy7Dju6Rr7uENqdNVA==

View File

@@ -1,95 +1,64 @@
# /etc/nginx/nginx.conf
user nginx;
pid /var/run/nginx.pid;
# Enables the use of JIT for regular expressions to speed-up their processing.
pcre_jit on;
# Configures default error logger.
error_log /var/log/omc/nginx/error.log warn;
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
# The maximum number of simultaneous connections that can be opened by
# a worker process.
worker_connections 1024;
}
worker_connections 1024;
# multi_accept on;
}
http {
# Includes mapping of file name extensions to MIME types of responses
# and defines the default type.
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Name servers used to resolve names of upstream servers into addresses.
# It's also needed when using tcpsocket and udpsocket in Lua modules.
#resolver 1.1.1.1 1.0.0.1 2606:4700:4700::1111 2606:4700:4700::1001;
##
# Basic Settings
##
# Don't tell nginx version to the clients. Default is 'on'.
sendfile on;
tcp_nopush on;
types_hash_max_size 2048;
server_tokens off;
# Specifies the maximum accepted body size of a client request, as
# indicated by the request header Content-Length. If the stated content
# length is greater than this size, then the client receives the HTTP
# error code 413. Set to 0 to disable. Default is '1m'.
client_max_body_size 1024m;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
# Sendfile copies data between one FD and other from within the kernel,
# which is more efficient than read() + write(). Default is off.
sendfile on;
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Causes nginx to attempt to send its HTTP response head in one packet,
# instead of using partial frames. Default is 'off'.
tcp_nopush on;
##
# SSL Settings
##
# Enables the specified protocols. Default is TLSv1 TLSv1.1 TLSv1.2.
# TIP: If you're not obligated to support ancient clients, remove TLSv1.1.
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
# Path of the file with Diffie-Hellman parameters for EDH ciphers.
# TIP: Generate with: `openssl dhparam -out /etc/ssl/nginx/dh2048.pem 2048`
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
ssl_dhparam /etc/nginx/cert/dhparams.pem;
# Specifies that our cipher suits should be preferred over client ciphers.
# Default is 'off'.
ssl_prefer_server_ciphers on;
# Enables a shared SSL cache with size that can hold around 8000 sessions.
# Default is 'none'.
ssl_session_cache shared:SSL:2m;
# Specifies a time during which a client may reuse the session parameters.
# Default is '5m'.
ssl_session_timeout 1h;
# Disable TLS session tickets (they are insecure). Default is 'on'.
ssl_session_tickets off;
# Helper variable for proxying websockets.
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
# Specifies the main log format.
##
# Logging Settings
##
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
# Sets the path, format, and configuration for a buffered log write.
access_log /var/log/omc/nginx/access.log main;
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log;
keepalive_timeout 65;
##
# Gzip Settings
##
# Enable gzipping of responses.
gzip on;
gzip_static on;
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_comp_level 5;
gzip_types text/plain application/javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
# Set the Vary HTTP header as defined in the RFC 2616. Default is 'off'.
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
##
# Virtual Host Configs
##
keepalive_timeout 65;
client_max_body_size 1024m;
server {
listen 80;
@@ -103,18 +72,19 @@ http {
#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_certificate /etc/nginx/cert/www.x.cn_chain.crt;
# ssl_certificate_key /etc/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;
# ssl_dhparam /etc/nginx/cert/dhparams.pem;
# OMC
location / {
root /usr/local/etc/omc/frontend;
root /usr/local/bin/web;
#root /usr/local/etc/omc/frontend;
try_files $uri $uri/ /index.html;
index index.html index.htm;
@@ -163,5 +133,4 @@ http {
root /usr/local/etc/omc/frontend;
}
}
}

View File

@@ -3,7 +3,7 @@
# duration: rotation time with xx hours, example: 1/12/24 hours
# count: rotation count of log, default is 30 rotation
logger:
file: "/var/log/omc/restagent.log"
file: "/var/log/restagent.log"
level: debug
duration: 24
count: 2