Skip to content

Pasty behind Reverse Proxy as Subpath #46

@GAS85

Description

@GAS85

Hey, cool Product!

I try to run it as Sub-path on Apache2 Server e.g. https://FQDN/pasty/ with few rewrite rules, but not really successful.

  1. I use docker compose
version: "3.6"
services:
  pasty:
    image: ghcr.io/lus/pasty:latest
    container_name: pasty
    restart: unless-stopped
    environment:
      - PASTY_AUTODELETE="true"
      - PASTY_AUTODELETE_LIFETIME="336h"
      - PASTY_AUTODELETE_TASK_INTERVAL="24h"
    ports:
      - "9016:8080"
  1. Now it works on my localhost:9016
  2. I see that there a 2 endpoints, webUI and api calls, so I add Apache2 Rewrite rules:
#Pasty
	<Location /api/v2/>
		RewriteEngine  on
		RewriteRule /api/v2/(.*) http://localhost:9016/api/v2/$1 [P,L]
		ProxyPreserveHost On
		ProxyPass http://localhost:9016/api/v2/ retry=0 connectiontimeout=5 timeout=30 keepalive=on
		ProxyPassReverse http://localhost:9016/api/v2/
		RequestHeader set Connection ""
	</Location>

Redirect 301 "/pasty" "/pasty/"
	<Location /pasty/>
		ProxyPreserveHost On
		ProxyPass http://localhost:9016/ retry=0 connectiontimeout=5 timeout=30 keepalive=on
		ProxyPassReverse http://localhost:9016/
		RequestHeader set Connection ""
	</Location>
  1. Not really works:(((
    How to expose this app as Subpath?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions