#user http; # https://freenginx.org/en/docs/ngx_core_module.html#worker_processes worker_processes auto; #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; #gzip on; # nginx warning in journal or `sudo nginx -t`: "could not build optimal types_hash, you should increase either types_hash_max_size: 1024 or types_hash_bucket_size: 64; ignoring types_hash_bucket_size" # default is 1024, I increased to 2048 and still throws warning, I increase 4096 and warning is gone # not fully understood # https://wiki.archlinux.org/title/nginx#Warning:_Could_not_build_optimal_types_hash # https://nginx.org/en/docs/http/ngx_http_core_module.html # https://nginx.org/en/docs/hash.html # https://nginx.org/en/docs/http/server_names.html types_hash_max_size 4096; # https://freenginx.org/en/docs/http/ngx_http_v2_module.html#example http2 on; server { listen 80; # needed for ipv6 listen [::]:80; # needed for http3 quic # https://freenginx.org/en/docs/quic.html # https://oheng.com/enabling-http-3-under-nginx/ # # http3 quic can be testd with https://http3check.net # # Note reuseport should only be used once per address:port pair. # https://serverfault.com/a/1000428 points out that # https://freenginx.org/en/docs/http/ngx_http_core_module.html#listen # wrote: "The listen directive can have several additional parameters # specific to socket-related system calls. These parameters can be # specified in any listen directive, but only once for a given # address:port pair." Also see https://stackoverflow.com/q/76348128 listen 443 quic reuseport; listen [::]:443 quic reuseport; # https://nginx.org/en/docs/http/configuring_https_servers.html#single_http_https_server listen 443 ssl; listen [::]:443 ssl; server_name flylightning.xyz; ssl_certificate /etc/postfix/flylightning.pem; ssl_certificate_key /etc/postfix/flylightning.key; # needed for http3 quic # https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Alt-Svc add_header Alt-Svc 'h3=":443"; ma=86400'; #charset koi8-r; #access_log logs/host.access.log main; location / { root /srv/http/master; index index.html; } #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/share/nginx/html; #} # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root html; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} #!/bin/sh loop ssh "${1:-phone}"