Improve installation docs

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-06-16 10:57:11 +02:00
parent 061f51447e
commit 02b32f1e83
5 changed files with 122 additions and 14 deletions

View File

@@ -11,7 +11,15 @@ server {
listen 80;
listen [::]:80;
return 301 https://$server_name$request_uri;
# Remove once HTTPS is setup
location ^~ '/.well-known/acme-challenge' {
root /var/www/certbot;
default_type "text/plain";
}
# Uncomment once HTTPS is setup
# return 301 https://$server_name$request_uri;
}
server {
@@ -21,9 +29,10 @@ server {
listen [::]:443 ssl http2;
ssl_session_timeout 5m;
ssl_trusted_certificate /etc/letsencrypt/live/example.tld/fullchain.pem;
ssl_certificate /etc/letsencrypt/live/example.tld/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.tld/privkey.pem;
# Uncomment once you get the certificates
# ssl_trusted_certificate /etc/letsencrypt/live/example.tld/fullchain.pem;
# ssl_certificate /etc/letsencrypt/live/example.tld/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/example.tld/privkey.pem;
# Add TLSv1.3 if it's supported by your system
ssl_protocols TLSv1.2;
@@ -46,6 +55,12 @@ server {
# the nginx default is 1m, not enough for large media uploads
client_max_body_size 16m;
# Let's Encrypt keeps its files here
location ^~ '/.well-known/acme-challenge' {
root /var/www/certbot;
default_type "text/plain";
}
location / {
gzip off;
proxy_http_version 1.1;
@@ -65,7 +80,7 @@ server {
}
location ~* \.(css|js)$ {
root /var/www/mobilizon/priv/static;
root /home/mobilizon/live/priv/static;
etag off;
expires 1y;
access_log off;

View File

@@ -4,13 +4,15 @@ After=network.target postgresql.service
[Service]
User=mobilizon
WorkingDirectory=/home/mobilizon/mobilizon
ExecStart=/usr/local/bin/mix phx.server
WorkingDirectory=/home/mobilizon/live
ExecStart=/usr/bin/env mix phx.server
ExecReload=/bin/kill $MAINPID
KillMode=process
Restart=on-failure
Environment=MIX_ENV=prod
SyslogIdentifier=mobilizon
; Some security directives.
; Use private /tmp and /var/tmp folders inside a new file system namespace, which are discarded after the process stops.
PrivateTmp=true