Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Suggestions for optimizing nginx configuration files #485

Open
1 task done
JarmoHu opened this issue Dec 13, 2024 · 2 comments
Open
1 task done

[BUG] Suggestions for optimizing nginx configuration files #485

JarmoHu opened this issue Dec 13, 2024 · 2 comments

Comments

@JarmoHu
Copy link

JarmoHu commented Dec 13, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

If I forward tcp port 30000 to port 443, an error will occur when accessing.
Then I modified the configuration file in nginx, It's all right
original:

    location ^~ /.well-known {
        # The rules in this block are an adaptation of the rules
        # in `.htaccess` that concern `/.well-known`.

        location = /.well-known/carddav { return 301 /remote.php/dav/; }
        location = /.well-known/caldav  { return 301 /remote.php/dav/; }

        location /.well-known/acme-challenge    { try_files $uri $uri/ =404; }
        location /.well-known/pki-validation    { try_files $uri $uri/ =404; }

        # Let Nextcloud's API for `/.well-known` URIs handle all other
        # requests by passing them to the front-end controller.
        return 301 /index.php$request_uri;
    }

modified:

    location ^~ /.well-known {
        # The rules in this block are an adaptation of the rules
        # in `.htaccess` that concern `/.well-known`.

        location = /.well-known/carddav { return 301 $scheme://$http_host/remote.php/dav/; }
        location = /.well-known/caldav  { return 301 $scheme://$http_host/remote.php/dav/; }

        location /.well-known/acme-challenge    { try_files $uri $uri/ =404; }
        location /.well-known/pki-validation    { try_files $uri $uri/ =404; }

        # Let Nextcloud's API for `/.well-known` URIs handle all other
        # requests by passing them to the front-end controller.
        return 301 $scheme://$http_host/index.php$request_uri;
    }

Expected Behavior

No response

Steps To Reproduce

no

Environment

- OS:
- How docker service was installed:

CPU architecture

x86-64

Docker creation

services:
  nextcloud:
    image: linuxserver/nextcloud:latest
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Asia/Shanghai
    volumes:
      - /mnt/myssd1/docker_path/nextcloud/config:/config
      - /mnt/myssd1/docker_path/nextcloud/data:/data
      # - /srv:/srv
    ports:
      - 32080:80
      - 32443:443
      - 30003:30003
      - 30004:30004
    restart: unless-stopped
    depends_on:
      - db
      - redis

  db:
    image: mariadb
    restart: unless-stopped
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    volumes:
      - /mnt/myssd1/docker_path/nextcloud/db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=xxx
      - MYSQL_PASSWORD=xxx
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

  redis:
    image: redis:alpine
    restart: unless-stopped
    volumes:
      - /mnt/myssd1/docker_path/nextcloud/redis/data:/data

Container logs

no
Copy link

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@aptalca
Copy link
Member

aptalca commented Dec 13, 2024

Your suggestion would cause issues for others

You really should be using a reverse proxy with a 3rd party validated cert and serving https over port 443

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Issues
Development

No branches or pull requests

2 participants