P
P
Pasha Ignatiev2016-08-22 16:30:20
Nginx
Pasha Ignatiev, 2016-08-22 16:30:20

How to pass owncloud through nginx with subdomain added?

Good afternoon! On one server, nginx is running (not configured by me, the tuner cannot be found), a domain with subdomains scattered over other servers looks at it. I decided to raise owncloud on one free machine, with a subdomain and hiding /owncloud/. I am zero in nginx. Here is the configuration:

server {
    listen                  80;
    listen                  443 ssl;
    server_name             cloud.домен.ru;

    rewrite ^(/owncloud/.*)$ https://$server_name$request_uri? permanent;

    ssl_certificate         домен.ru_bundle.crt;
    ssl_certificate_key     домен.ru.key;
    ssl_protocols           TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers             HIGH:!aNULL:!MD5;
 
    server_name_in_redirect on;
    keepalive_timeout       70;
                                                        
#       access_log  logs/host.access.log  main;
             
        rewrite ^/(.*)$ /owncloud/$1 last;
                                
        location /owncloud/ {
                proxy_pass http://10.10.10.11:80;
                proxy_redirect http://cloud.домен.ru/owncloud /;

                proxy_set_header   Host             $host;
                proxy_set_header   X-Real-IP        $remote_addr;
                proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
                client_max_body_size       10m;
                client_body_buffer_size    128k;
                proxy_connect_timeout      90;
                proxy_send_timeout         90;
                proxy_read_timeout         90;
                                                                                                        
                proxy_buffer_size          4k;
                proxy_buffers              4 32k;
                proxy_busy_buffers_size    64k;
                proxy_temp_file_write_size 64k;
      }
}

Gives URL with double slash and not working css and js:
https://cloud.домен.ru//index.php/login
I repeat. It is far from Nginx, and this configuration is just an adaptation of one of the existing ones.
Thank you!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question