SHARE
TWEET

Untitled

a guest Jun 11th, 2019 101 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. How can I do it with nginx? That isnt working for me: https://icewind.nl/entry/collabora-online/ Every time i open: https://office.mydomain.tk/ I got this:
  2. Welcome to nginx!
  3. If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
  4.  
  5. For online documentation and support please refer to nginx.org.
  6. Commercial support is available at nginx.com.
  7.  
  8. Thank you for using nginx.
  9. Thats my config:
  10. upstream php-handler {
  11.     server 127.0.0.1:9000;
  12.     server unix:/run/php/php7.2-fpm.sock;
  13. }
  14.  
  15.  
  16. server {
  17.     listen 80;
  18.     listen [::]:80;
  19.     server_name mydomain.tk;
  20.     # enforce https
  21.     return 301 https://$server_name$request_uri;
  22. }
  23.  
  24.  
  25. server {
  26.     listen 443 ssl http2;
  27.     listen [::]:443 ssl http2;
  28.     server_name mydomain.tk;
  29.  
  30.  
  31.     # Use Mozilla's guidelines for SSL/TLS settings
  32.     # https://mozilla.github.io/server-side-tls/ssl-config-generator/
  33.     # NOTE: some settings below might be redundant
  34.     ssl_certificate /etc/letsencrypt/live/mydomain.tk-0001/fullchain.pem;
  35.     ssl_certificate_key /etc/letsencrypt/live/mydoamin.tk-0001/privkey.pem;
  36.  
  37.  
  38.     # Add headers to serve security related headers
  39.     # Before enabling Strict-Transport-Security headers please read into this
  40.     # topic first.
  41.     add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
  42.     #
  43.     # WARNING: Only add the preload option once you read about
  44.     # the consequences in https://hstspreload.org/. This option
  45.     # will add the domain to a hardcoded list that is shipped
  46.     # in all major browsers and getting removed from this list
  47.     # could take several months.
  48.     add_header X-Content-Type-Options nosniff;
  49.     add_header X-XSS-Protection "1; mode=block";
  50.     add_header X-Robots-Tag none;
  51.     add_header X-Download-Options noopen;
  52.     add_header X-Permitted-Cross-Domain-Policies none;
  53.     add_header Referrer-Policy no-referrer;
  54.  
  55.  
  56.     # Remove X-Powered-By, which is an information leak
  57.     fastcgi_hide_header X-Powered-By;
  58.  
  59.  
  60.     # Path to the root of your installation
  61.     root /var/www/html/cloud/;
  62.  
  63.  
  64.     location = /robots.txt {
  65.         allow all;
  66.         log_not_found off;
  67.         access_log off;
  68.     }
  69.  
  70.  
  71.     # The following 2 rules are only needed for the user_webfinger app.
  72.     # Uncomment it if you're planning to use this app.
  73.     #rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
  74.     #rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
  75.  
  76.  
  77.     location = /.well-known/carddav {
  78.       return 301 $scheme://$host/remote.php/dav;
  79.     }
  80.     location = /.well-known/caldav {
  81.       return 301 $scheme://$host/remote.php/dav;
  82.     }
  83.  
  84.  
  85.  
  86.  
  87.     # set max upload size
  88.     client_max_body_size 5102M;
  89.     fastcgi_buffers 64 4K;
  90.  
  91.  
  92.     # Enable gzip but do not remove ETag headers
  93.     gzip on;
  94.     gzip_vary on;
  95.     gzip_comp_level 4;
  96.     gzip_min_length 256;
  97.     gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
  98.     gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
  99.  
  100.  
  101.     # Uncomment if your server is build with the ngx_pagespeed module
  102.     # This module is currently not supported.
  103.     #pagespeed off;
  104.  
  105.  
  106.     location / {
  107.         rewrite ^ /index.php$request_uri;
  108.     }
  109.  
  110.  
  111.     location ~ ^\/(?:build|tests|config|lib|3rdparty|templates|data)\/ {
  112.         deny all;
  113.     }
  114.     location ~ ^\/(?:\.|autotest|occ|issue|indie|db_|console) {
  115.         deny all;
  116.     }
  117.  
  118.  
  119.     location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|ocs-provider\/.+)\.php(?:$|\/) {
  120.         fastcgi_split_path_info ^(.+?\.php)(\/.*|)$;
  121.         include fastcgi_params;
  122.         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  123.         fastcgi_param PATH_INFO $fastcgi_path_info;
  124.         fastcgi_param HTTPS on;
  125.         #Avoid sending the security headers twice
  126.         fastcgi_param modHeadersAvailable true;
  127.         fastcgi_param front_controller_active true;
  128.         fastcgi_pass php-handler;
  129.         fastcgi_intercept_errors on;
  130.         fastcgi_request_buffering off;
  131.     }
  132.  
  133.  
  134.     location ~ ^\/(?:updater|ocs-provider)(?:$|\/) {
  135.         try_files $uri/ =404;
  136.         index index.php;
  137.     }
  138.  
  139.  
  140.     # Adding the cache control header for js and css files
  141.     # Make sure it is BELOW the PHP block
  142.     location ~ \.(?:css|js|woff2?|svg|gif)$ {
  143.         try_files $uri /index.php$request_uri;
  144.         add_header Cache-Control "public, max-age=15778463";
  145.         # Add headers to serve security related headers (It is intended to
  146.         # have those duplicated to the ones above)
  147.         # Before enabling Strict-Transport-Security headers please read into
  148.         # this topic first.
  149.         # add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
  150.         #
  151.         # WARNING: Only add the preload option once you read about
  152.         # the consequences in https://hstspreload.org/. This option
  153.         # will add the domain to a hardcoded list that is shipped
  154.         # in all major browsers and getting removed from this list
  155.         # could take several months.
  156.         add_header X-Content-Type-Options nosniff;
  157.         add_header X-XSS-Protection "1; mode=block";
  158.         add_header X-Robots-Tag none;
  159.         add_header X-Download-Options noopen;
  160.         add_header X-Permitted-Cross-Domain-Policies none;
  161.         add_header Referrer-Policy no-referrer;
  162.  
  163.  
  164.         # Optional: Don't log access to assets
  165.         access_log off;
  166.     }
  167.  
  168.  
  169.     location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
  170.         try_files $uri /index.php$request_uri;
  171.         # Optional: Don't log access to other assets
  172.         access_log off;
  173.     }
  174. }
  175.  
  176.  
  177.  
  178.  
  179. server {
  180.     listen       443 ssl;
  181.     server_name  office.mydomain.tk;
  182.  
  183.  
  184.     ssl_certificate  /etc/letsencrypt/live/office.mydomain.tk/fullchain.pem;
  185.     ssl_certificate_key /etc/letsencrypt/live/office.mydomain.tk/privkey.pem;
  186.    
  187.     # static files
  188.     location ^~ /loleaflet {
  189.         proxy_pass https://localhost:9980;
  190.         proxy_set_header Host $http_host;
  191.     }
  192.  
  193.  
  194.     # WOPI discovery URL
  195.     location ^~ /hosting/discovery {
  196.         proxy_pass https://localhost:9980;
  197.         proxy_set_header Host $http_host;
  198.     }
  199.  
  200.  
  201.    # main websocket
  202.    location ~ ^/lool/(.*)/ws$ {
  203.        proxy_pass https://localhost:9980;
  204.        proxy_set_header Upgrade $http_upgrade;
  205.        proxy_set_header Connection "Upgrade";
  206.        proxy_set_header Host $http_host;
  207.        proxy_read_timeout 36000s;
  208.    }
  209. }
  210. Thanks for help
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top