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

Allow access behind reverse proxy including subdirectory url #47

Open
smacz42 opened this issue Jul 13, 2019 · 0 comments
Open

Allow access behind reverse proxy including subdirectory url #47

smacz42 opened this issue Jul 13, 2019 · 0 comments

Comments

@smacz42
Copy link
Contributor

smacz42 commented Jul 13, 2019

Similar to coleifer/sqlite-web@62be325 I want to put this service behind a reverse proxy that puts this service in a subdirectory.

Expected Behavior

The service has a configurable option to set the subdirectory that it operates in.

Actual Behavior

An NGINX config like the following is required to have the application operate in a subdirectory:

location /ldapcherry/ {         
    proxy_pass http://ldapcherry:8080/;        
    proxy_redirect default;                 
}                                                                                                                      
                                                           
location /static/ {                   
    proxy_headers_hash_max_size 512;
    proxy_headers_hash_bucket_size 64;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    add_header Front-End-Https on;             
    proxy_pass http://ldapcherry:8080;      
}                                                                                                                      
                                                           
location /selfmodify/ {               
    proxy_headers_hash_max_size 512;
    proxy_headers_hash_bucket_size 64;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    add_header Front-End-Https on;             
    proxy_pass http://ldapcherry:8080;      
}                                                                                                                      
                                                           
location /selfmodify {                
    proxy_headers_hash_max_size 512;
    proxy_headers_hash_bucket_size 64;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    add_header Front-End-Https on;             
    proxy_pass http://ldapcherry:8080;      
}

location /searchuser/ {
    proxy_headers_hash_max_size 512;
    proxy_headers_hash_bucket_size 64;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    add_header Front-End-Https on;
    proxy_pass http://ldapcherry:8080;
}

location /checkppolicy {
    proxy_headers_hash_max_size 512;
    proxy_headers_hash_bucket_size 64;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    add_header Front-End-Https on;
    proxy_pass http://ldapcherry:8080;
}

location /logout {
    proxy_headers_hash_max_size 512;
    proxy_headers_hash_bucket_size 64;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    add_header Front-End-Https on;
    proxy_pass http://ldapcherry:8080;
}

Where ldapcherry:8080 is the host and the port behind the reverse proxy.

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

No branches or pull requests

1 participant