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

Monica Nginx Reverse Proxy #7404

Open
3 tasks done
Funkster120 opened this issue Oct 13, 2024 · 0 comments
Open
3 tasks done

Monica Nginx Reverse Proxy #7404

Funkster120 opened this issue Oct 13, 2024 · 0 comments
Labels

Comments

@Funkster120
Copy link

Funkster120 commented Oct 13, 2024

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • I agree to follow Monica's Code of Conduct.

Bug description

When accessing via Reverse Proxy "502 Bad Gateway" appears

Steps to reproduce

.env, docker-compose.yml and Custom Nginx Config attached

APP_ENV=production
APP_DEBUG=false

# Must be 32 characters long exactly.
# Use `php artisan key:generate` or `pwgen -s 32 1` to generate a random key.
APP_KEY=ddDR0t8E666HH29tL2Fj281sJ2uh1WRQ
HASH_SALT=ddDRs8HH29t1UF2t8Evd
HASH_LENGTH=18
APP_URL=https://monica.example.com
APP_FORCE_URL=false
DB_CONNECTION=mysql
DB_HOST=db
DB_PORT=3306
DB_DATABASE=monica
DB_USERNAME=monica
DB_PASSWORD=monica01
DB_PREFIX=
DB_USE_UTF8MB4=true

# Mail credentials used to send emails from the application.
MAIL_MAILER=smtp
MAIL_HOST=
MAIL_PORT=25
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=
MAIL_FROM_NAME="CRM"
APP_EMAIL_NEW_USERS_NOTIFICATION=
APP_DISABLE_SIGNUP=true
APP_SIGNUP_DOUBLE_OPTIN=false
APP_TRUSTED_PROXIES=*   # use a comma separated list of IP addresses.
APP_TRUSTED_CLOUDFLARE=false
LOG_CHANNEL=daily
SENTRY_SUPPORT=false
SENTRY_LARAVEL_DSN=
CHECK_VERSION=false
REDIS_HOST=redis
CACHE_DRIVER=redis     # database, file, memcached, redis, dynamodb
SESSION_DRIVER=redis   # file, cookie, database, apc, memcached, redis, array
SESSION_LIFETIME=120
QUEUE_CONNECTION=sync
DEFAULT_FILESYSTEM=public
DEFAULT_MAX_STORAGE_SIZE=512
DEFAULT_MAX_UPLOAD_SIZE=10240
MFA_ENABLED=true
DAV_ENABLED=true
ALLOW_STATISTICS_THROUGH_PUBLIC_API_ACCESS=false
POLICY_COMPLIANT=true
ENABLE_GEOLOCATION=false
LOCATION_IQ_API_KEY=
ENABLE_WEATHER=false
DARKSKY_API_KEY
```=
``
---
#version: '3'
services:
  monicahq:
    image: monica
    container_name: monica
    restart: unless-stopped
    depends_on:
      - db
    env_file:
      - ./.env
    environment:
      - TZ=Europe/Berlin
      - APP_KEY=ddDR0t8E4s8HH19t333jt81sJNuh1WRQ
      - APP_ENV=production
      - APP_URL=https://monica.example.com
      - APP_FORCE_URL=false
      - DB_HOST=db
    ports:
      - "5020:80"
    volumes:
      - ./data:/var/www/html/storage
      - ./html:/var/www/monica:ro
  db:
    image: mysql:5.7
    container_name: monica-db
    restart: unless-stopped
    environment:
      - MYSQL_RANDOM_ROOT_PASSWORD=true
      - MYSQL_DATABASE=monica
      - MYSQL_USER=monica
      - MYSQL_PASSWORD=monica01
    volumes:
      - ./mysql:/var/lib/mysql

  redis:
    image: redis:alpine
    container_name: monica-redis
    restart: unless-stopped
    volumes:
      - ./redis:/data`

`       location / {
        proxy_pass http://127.0.0.1:5020;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        }`

### Expected behavior

SSL Secured Monica Frontend

### Environment

Your own self-hosted instance (monica v4)

### Version of Monica

_No response_

### Installation method

None

### Web server

None

### Database engine version

None

### Additional info

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

No branches or pull requests

1 participant