Advertisement
Guest User

Untitled

a guest
Apr 21st, 2024
79
0
16 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 2.26 KB | Software | 0 0
  1. server {
  2.     if ($host = cloud.domain.com) {
  3.         return 301 https://$host$request_uri;
  4.     } # managed by Certbot
  5.  
  6.     listen 80;
  7.     server_name cloud.domain.com;
  8. }
  9. server {
  10.     listen       443 ssl http2;
  11.    
  12. server_name  cloud.domain.com;
  13.  
  14.     error_log   /var/log/nginx/cloud.domain.com.error.log error;
  15.     access_log   /var/log/nginx/cloud.domain.com.access.log main;
  16.  
  17.     location ^~ /.well-known {
  18.         # The rules in this block are an adaptation of the rules
  19.         # in `.htaccess` that concern `/.well-known`.
  20.  
  21.         location = /.well-known/carddav { return 301 /remote.php/dav/; }
  22.         location = /.well-known/caldav  { return 301 /remote.php/dav/; }
  23.  
  24.         location /.well-known/acme-challenge    { try_files $uri $uri/ =404; }
  25.         location /.well-known/pki-validation    { try_files $uri $uri/ =404; }
  26.  
  27.         # Let Nextcloud's API for `/.well-known` URIs handle all other
  28.         # requests by passing them to the front-end controller.
  29.         return 301 /index.php$request_uri;
  30.     }
  31.  
  32.     location / {
  33.         proxy_redirect          off;
  34.         proxy_set_header        Host            $host;
  35.         proxy_set_header        X-Forwarded-Proto $scheme;
  36.         proxy_set_header        X-Real-IP       $remote_addr;
  37.         proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
  38.         proxy_set_header        Strict-Transport-Security       15552000;
  39.         proxy_pass_request_headers      on;
  40.         proxy_connect_timeout   600;
  41.         proxy_send_timeout      600;
  42.         proxy_read_timeout      600;
  43.         proxy_buffering         off;
  44.         proxy_pass http://10.60.5.96:80/;
  45.     }
  46.  
  47.     location /office {
  48.         proxy_redirect          off;
  49.         proxy_set_header        Host            $host;
  50.         proxy_set_header        X-Forwarded-Proto $scheme;
  51.         proxy_set_header        X-Real-IP       $remote_addr;
  52.         proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
  53.         proxy_pass_request_headers      on;
  54.         proxy_connect_timeout   90;
  55.         proxy_send_timeout      120;
  56.         proxy_read_timeout      120;
  57.         proxy_pass https://10.60.5.95:443/;
  58.         proxy_ssl_verify              off;
  59.     }
  60.  
  61.     include default.d/custom_ssl_cert_domain.com.conf;
  62.  
  63. }
  64.  
Tags: nginx
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement