M
M
MrDZ2021-10-14 17:07:27
linux
MrDZ, 2021-10-14 17:07:27

How to disable translation to nextcloud port 443?

Deployed nextcloud (nc) and onlyoffice (oo). Homepage nc and oo open. nc Hangs on port 81, oo on port 82.
Did according to the post https://habr.com/en/post/563704/ . I didn’t bother with ssl, because unfolded for the test and there is no need to let it out. Therefore, the contents of the /etc/nginx/sites-enable/nextcloud.conf file did not change much (see below). The problem is that when you enter your login password to enter, you are redirected to port 443, I don’t understand how to win. https://192.168.0.14:81/index.php/apps/dashboard/

PS. I’ll write why I didn’t use docker to deploy this service - I have little experience in linux. (Yes, I deployed it, but everything works, but here's how to change something now, for example: change trusted_domains in xs containers, I'll leave it for study)) although it can be simple)

server {
        listen 81;
        server_name 192.168.0.14;

        root /var/www/nextcloud;

        add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" alwa>
        client_max_body_size 10G;
        fastcgi_buffers 64 4K;

        rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
        rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
        rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;

        index index.php;
        error_page 403 = /core/templates/403.php;
        error_page 404 = /core/templates/404.php;


        location = /robots.txt {
            allow all;
            log_not_found off;
            access_log off;
        }



        location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
                deny all;
        }

        location / {
                rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
                rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-jso>
                rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
                rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
                rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
                try_files $uri $uri/ index.php;
        }


         location ~ ^(.+?\.php)(/.*)?$ {
                try_files $1 = 404;
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME $document_root$1;
                fastcgi_param PATH_INFO $2;
                fastcgi_param HTTPS on;
                fastcgi_pass unix:/run/php/php7.4-fpm.sock;
        }

        location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
                expires modified +30d;

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
ky0, 2021-10-14
@ky0

At the very least, remove the title Strict-Transport-Security. It is also possible that somewhere right in the configs there is a redirect flag to the secure version.
IMHO, it's not worth deploying a deliberately unviable configuration even for a test - especially in our time, when you can easily get a free valid certificate.

D
Drno, 2021-10-14
@Drno

the meaning is that in conjunction with the office it requires SSL ... for work

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question