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 proxy and tile legal information support #179

Merged
merged 5 commits into from
Jan 22, 2025

Conversation

Waguramu
Copy link
Contributor

@Waguramu Waguramu commented Jan 17, 2025

Goal: allow users to:

  • configure proxy when using erdblick
  • access legal information (per map) if it is set on any loaded tiles

Scope:

  • Angular app and WASM sources

Deliverables:

  • erdblick is using relative paths for http calls (necessary for proxy support)
  • legal information for tiles is propagated from mapget to MapService

How to test:

  1. Build as usual.
  2. Serve with Island 1.
  3. Configure a basic proxy as follows:
server {
    listen 80;
    server_name <your-server-name>;
    
    location /<your-sub-path>/ {
        proxy_pass http://127.0.0.1:8089/;
        
        proxy_http_version 1.1;
        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;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        
        # Replace absolute paths in HTML/JS responses
        sub_filter_types text/html;
        sub_filter 'src="/' 'src="/<your-sub-path>/';
        sub_filter 'href="/' 'href="/<your-sub-path>/';
        sub_filter_once off;
    }
    
    # Handle absolute path requests by forwarding them to the app path
    location / {
        rewrite ^/bundle/(.*) /<your-sub-path>/bundle/$1 last;
        rewrite ^/config.json /<your-sub-path>/config.json last;
        rewrite ^/favicon.ico /<your-sub-path>/favicon.ico last;
        return 404;
    }
}
  1. Examine tiles' legal information if present by clicking the link in the bottom right corner (only shown if there is any legal information).

@Waguramu Waguramu requested a review from MisterGC January 17, 2025 14:04
@Waguramu Waguramu self-assigned this Jan 17, 2025
@josephbirkner josephbirkner self-requested a review January 22, 2025 14:34
@Waguramu Waguramu changed the title Allow proxy support Allow proxy and tile legal information support Jan 22, 2025
@Waguramu Waguramu merged commit 4f16ebf into fix-featureid-key-hover Jan 22, 2025
2 checks passed
@Waguramu Waguramu deleted the nginx-proxy-support branch January 22, 2025 16:46
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

Successfully merging this pull request may close these issues.

1 participant