forked from infra/ansible
39 lines
848 B
Plaintext
39 lines
848 B
Plaintext
|
server {
|
||
|
listen 80;
|
||
|
listen [::]:80;
|
||
|
|
||
|
server_name {{ owncloud_domain }};
|
||
|
|
||
|
location /.well-known/acme-challenge/ {
|
||
|
default_type "text/plain";
|
||
|
root /var/www/acme-challenge/;
|
||
|
}
|
||
|
|
||
|
location / {
|
||
|
return 301 https://{{ owncloud_domain }}$request_uri;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
server {
|
||
|
listen 443 ssl http2;
|
||
|
listen [::]:443 ssl http2;
|
||
|
|
||
|
server_name {{ owncloud_domain }};
|
||
|
|
||
|
ssl_certificate_key /etc/nginx/ssl/{{ owncloud_domain }}.key;
|
||
|
ssl_certificate /etc/nginx/ssl/{{ owncloud_domain }}.crt;
|
||
|
|
||
|
root /var/www/owncloud/;
|
||
|
|
||
|
location ~ \.php$ {
|
||
|
try_files $uri =404;
|
||
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||
|
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
|
||
|
# With php5-fpm:
|
||
|
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
||
|
fastcgi_index index.php;
|
||
|
include fastcgi_params;
|
||
|
}
|
||
|
}
|