mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 09:10:30 +08:00
nginx only binds an IPv4 socket, if the listen option is specified without [::]. There are two possibilites to fix this issue. Either the listen option can be specified using only [::], and additionally including ipv6only=off. This makes nginx bind an IPv6 socket which is also able to handle IPv4 connections. Or the listen option can be specified twice, one with [::] and one without. This makes nginx bind two independent sockets. If the first option is chosen, IPv4 addresses are mapped into the IPv6 address space, which might break scripts, filters, etc. So, for now, the second option is chosen.
56 lines
1.2 KiB
Nginx Configuration File
56 lines
1.2 KiB
Nginx Configuration File
worker_processes 4;
|
|
|
|
# error_log /tmp/kvmd-nginx.error.log;
|
|
error_log stderr;
|
|
|
|
include /usr/share/kvmd/extras/*/nginx.ctx-main.conf;
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
use epoll;
|
|
multi_accept on;
|
|
}
|
|
|
|
http {
|
|
types_hash_max_size 4096;
|
|
server_names_hash_bucket_size 128;
|
|
|
|
access_log off;
|
|
|
|
include /etc/kvmd/nginx/mime-types.conf;
|
|
default_type application/octet-stream;
|
|
charset utf-8;
|
|
|
|
sendfile on;
|
|
tcp_nodelay on;
|
|
tcp_nopush on;
|
|
keepalive_timeout 10;
|
|
client_max_body_size 4k;
|
|
|
|
client_body_temp_path /tmp/kvmd-nginx.client_body_temp;
|
|
fastcgi_temp_path /tmp/kvmd-nginx.fastcgi_temp;
|
|
proxy_temp_path /tmp/kvmd-nginx.proxy_temp;
|
|
scgi_temp_path /tmp/kvmd-nginx.scgi_temp;
|
|
uwsgi_temp_path /tmp/kvmd-nginx.uwsgi_temp;
|
|
|
|
include /etc/kvmd/nginx/kvmd.ctx-http.conf;
|
|
include /usr/share/kvmd/extras/*/nginx.ctx-http.conf;
|
|
|
|
#PROD server {
|
|
#PROD listen 80;
|
|
#PROD listen [::]:80;
|
|
#PROD server_name localhost;
|
|
#PROD return 301 https://$host$request_uri;
|
|
#PROD }
|
|
|
|
server {
|
|
#PROD listen 443 ssl http2;
|
|
#PROD listen [::]:443 ssl http2;
|
|
server_name localhost;
|
|
#PROD include /etc/kvmd/nginx/ssl.conf;
|
|
|
|
include /etc/kvmd/nginx/kvmd.ctx-server.conf;
|
|
include /usr/share/kvmd/extras/*/nginx.ctx-server.conf;
|
|
}
|
|
}
|