Browse Source

added systemd service file and nginx conf

master
Sebastian 1 year ago
parent
commit
7f6f85df3b
Signed by: Sebastian Huebner <sebastian@hueb-ner.de> GPG Key ID: AFA10CBFE4391C0C
2 changed files with 78 additions and 0 deletions
  1. 64
    0
      install/wmia.nginx
  2. 14
    0
      install/wmia.service

+ 64
- 0
install/wmia.nginx View File

@@ -0,0 +1,64 @@
map $sent_http_content_type $expires {
default off;
text/html epoch;
text/css max;
}

server {
listen 80;
listen [::]:80;
server_name wmia.tld;

return 301 https://$server_name$request_uri;
}

server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name wmia.tld;

# SSL
ssl_trusted_certificate /etc/letsencrypt/live/wmia.tld/fullchain.pem;
ssl_certificate /etc/letsencrypt/live/wmia.tld/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/wmia.tld/privkey.pem;

# Settings created by https://mozilla.github.io/server-side-tls/ssl-config-generator/
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;
ssl_protocols TLSv1.2;
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
ssl_prefer_server_ciphers on;
ssl_ecdh_curve secp521r1:secp384r1:prime256v1;
ssl_stapling on;
ssl_stapling_verify on;
# HSTS header
add_header Strict-Transport-Security max-age=15768000;

# Gzip
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_types text/plain text/css application/json text/xml;

# Cache-control
expires $expires;

location ^~ /.well-known/acme-challenge/ {
allow all;
auth_basic off;
alias /var/www/dehydrated/;
}

location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_pass http://127.0.0.1:9090;
}
}

+ 14
- 0
install/wmia.service View File

@@ -0,0 +1,14 @@
[Unit]
Description=Whats my IP address service
After=network.target

[Service]
User=wmia
WorkingDirectory=/home/wmia/whats-my-ip-address
ExecStart=/usr/bin/lua5.3 wmia.lua
ExecReload=/bin/kill $MAINPID
KillMode=process
Restart=on-failure

[Install]
WantedBy=multi-user.target

Loading…
Cancel
Save