# Joplin Server and Nginx under subresource and HTTPS

**URL:** https://discourse.joplinapp.org/t/joplin-server-and-nginx-under-subresource-and-https/25934
**Category:** Support
**Created:** [5 June 2022 17:03 UTC](https://discourse.joplinapp.org/t/joplin-server-and-nginx-under-subresource-and-https/25934 "2022-06-05T17:03:05Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![mu88](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/mu88/32/21718_2.png) [@mu88](https://discourse.joplinapp.org/u/mu88)
#### Post date: [5 June 2022 17:03 UTC](https://discourse.joplinapp.org/t/joplin-server-and-nginx-under-subresource-and-https/25934/1 "2022-06-05T17:03:05Z")

</div>

Hi 👋🏻

I'm trying to set up Joplin Server on my Raspberry Pi. Here some basic facts:

- Joplin Server 2.7.4
- Raspberry Pi 4, `arm64/v8`

This is my `docker-compose.yml`:

```auto
version: '3'
services:
    app:
        environment:
            - APP_BASE_URL=http://myRaspi:22300
            - APP_PORT=22300
            - POSTGRES_PASSWORD=reallySecret
            - POSTGRES_DATABASE=joplin
            - POSTGRES_USER=joplin
            - POSTGRES_PORT=5432
            - POSTGRES_HOST=db
            - DB_CLIENT=pg
        restart: unless-stopped
        image: florider89/joplin-server:latest
        ports:
            - "22300:22300"
    db:
        restart: unless-stopped
        image: postgres:13.1
        ports:
            - "5432:5432"
        volumes:
            - /home/myUser/Docker/joplin-data:/var/lib/postgresql/data
        environment:
            - POSTGRES_PASSWORD=reallySecret
            - POSTGRES_USER=joplin
            - POSTGRES_DB=joplin

```

I'm using Nginx as reverse proxy and I can successfully access Joplin server via `http://myRaspi:22300`. But I'd like to host it under `https://myRaspi/joplinServer` with a redirect to `http://myRaspi:22300`. Nginx is already configured to serve `https://myRaspi`.

So I've tried the following `docker-compose.yml`:

```auto
version: '3'
services:
    app:
        environment:
            - APP_BASE_URL=https://myRaspi/joplinServer
            - APP_PORT=443
            - POSTGRES_PASSWORD=reallySecret
            - POSTGRES_DATABASE=joplin
            - POSTGRES_USER=joplin
            - POSTGRES_PORT=5432
            - POSTGRES_HOST=db
            - DB_CLIENT=pg
        restart: unless-stopped
        image: florider89/joplin-server:latest
        ports:
            - "22300:443"
    db:
        restart: unless-stopped
        image: postgres:13.1
        ports:
            - "5432:5432"
        volumes:
            - /home/myUser/Docker/joplin-data:/var/lib/postgresql/data
        environment:
            - POSTGRES_PASSWORD=reallySecret
            - POSTGRES_USER=joplin
            - POSTGRES_DB=joplin

```

And the Nginx config looks like this:

```auto
server {
    listen 443 ssl;
    ssl_certificate /etc/ssl/certs/myRaspi.crt;
    ssl_certificate_key /etc/nginx/ssl/certificates/myRaspi.pem;

    location /joplinServer {
        proxy_pass https://myRaspi:22300/joplinServer;
    }
}

```

But that gives me just `Bad Gateway`.

Can someone please help me figuring out how to make Joplin Server available via `https://myRaspi/joplinServer`?

Thank you!

---

_[View the full topic](https://discourse.joplinapp.org/t/joplin-server-and-nginx-under-subresource-and-https/25934)._
