Skip to content

Instantly share code, notes, and snippets.

@andreysfc

andreysfc/nginx.conf

Created Apr 20, 2019
Embed
What would you like to do?
Konfigurasi nginx.conf untuk Nextcloud
server {
listen 80;
listen [::]:80;
server_name jaranclouds.id;
location /.well-known/acme-challenge/ {
root /var/www/letsencrypt;
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
ssl_certificate /etc/nginx/jaranclouds-selfsigned.crt;
ssl_certificate_key /etc/nginx/jaranclouds-selfsigned.key;
server_name jaranclouds.id;
add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location = /.well-known/carddav {
return 301 $scheme://$host/remote.php/dav;
}
location = /.well-known/caldav {
return 301 $scheme://$host/remote.php/dav;
}
location = /.well-known/caldav {
return 301 $scheme://$host/remote.php/dav;
}
location @proxy {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass_header Server;
proxy_pass http://jaran_web:80;
proxy_buffering off;
proxy_redirect off;
proxy_http_version 1.1;
tcp_nodelay on;
}
location / {
try_files $uri @proxy;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment