#user http; 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; types { text/plain xmr; text/plain cfg; text/plain conf; text/plain sh; } #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; types_hash_max_size 4096; #gzip on; error_log /var/log/nginx/error.log; server { if ($host = cia.govt.hu) { return 301 https://$host$request_uri; } # managed by Certbot listen 80; server_name cia.govt.hu; #charset koi8-r; #access_log logs/host.access.log main; #location / { # root /usr/share/nginx/html; # index index.html index.htm; #} location / { rewrite ^ https://$server_name$request_uri? permanent; } location /.well-known { default_type text/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; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } # another virtual host using mix of IP-, name-, and port-based configuration # #server { # listen 8000; # listen somename:8080; # server_name somename alias another.alias; # location / { # root html; # index index.html index.htm; # } #} # HTTPS server # #server { # listen 443 ssl; # server_name localhost; # ssl_certificate cert.pem; # ssl_certificate_key cert.key; # ssl_session_cache shared:SSL:1m; # ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; # location / { # root html; # index index.html index.htm; # } #} server { root /usr/share/nginx/html; listen 443 ssl http2; listen [::]:443 ssl http2; location /.well-known { default_type application/json; } ssl_certificate /etc/letsencrypt/live/cia.govt.hu/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/cia.govt.hu/privkey.pem; # managed by Certbot # For the federation port listen 8448 ssl http2 default_server; listen [::]:8448 ssl http2 default_server; server_name cia.govt.hu; location ~ ^(/_matrix|/_synapse/client) { # note: do not add a path (even a single /) after the port in `proxy_pass`, # otherwise nginx will canonicalise the URI and cause signature verification # errors. proxy_pass http://localhost:8008; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $host; # Nginx by default only allows file uploads up to 1M in size # Increase client_max_body_size to match max_upload_size defined in homeserver.yaml client_max_body_size 65536M; # Synapse responses may be chunked, which is an HTTP/1.1 feature. proxy_http_version 1.1; } # location = /paste/ { # gzip off; # fastcgi_pass unix:/var/run/fcgiwrap.socket; # include /etc/nginx/fastcgi_params; # fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/paste/paste; #} location /datamining { autoindex on; } location /licenses { autoindex on; } location /music { autoindex on; } } }