Advertisement
Guest User

Untitled

a guest
Aug 11th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.44 KB | None | 0 0
  1. server {
  2.     listen 80 default_server;
  3.     listen [::]:80 default_server;
  4.  
  5.     # SSL configuration
  6.     ssl_dhparam /etc/ssl/certs/dhparam.pem;
  7.  
  8.     root /var/www/html;
  9.  
  10.     # Add index.php to the list if you are using PHP
  11.     index index.php index.html index.htm index.nginx-debian.html;
  12.  
  13.     server_name myhost my.domain;
  14.  
  15.     location /nextcloud/ {
  16.         proxy_pass http://127.0.0.1:8080/;
  17.         proxy_set_header Host $host;
  18.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  19.     }
  20.  
  21.     location / {
  22.         # First attempt to serve request as file, then
  23.         # as directory, then fall back to displaying a 404.
  24.         try_files $uri $uri/ =404;
  25.     }
  26.  
  27.         client_max_body_size 0;
  28.  
  29.     # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  30.     #
  31.         location ~ \.php$ {
  32.         include snippets/fastcgi-php.conf;
  33.             fastcgi_pass unix:/run/php/php7.0-fpm.sock;
  34.         }
  35.  
  36.     # deny access to .htaccess files, if Apache's document root
  37.     # concurs with nginx's one
  38.     #
  39.     #location ~ /\.ht {
  40.     #   deny all;
  41.     #}
  42.  
  43.     listen 443 ssl; # managed by Certbot
  44.     ssl_certificate /etc/letsencrypt/live/my.domain/fullchain.pem; # managed by Certbot  
  45.     ssl_certificate_key /etc/letsencrypt/live/my.domain/privkey.pem; # managed by Certbot
  46.     include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  47.  
  48.  
  49.     # Redirect non-https traffic to https
  50.     if ($scheme != "https") {
  51.         return 301 https://$host$request_uri;
  52.     } # managed by Certbot
  53.  
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement