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

Add ARCHIVA_CONTEXT_PATH env var #3

Merged
merged 4 commits into from Apr 1, 2016
Merged

Add ARCHIVA_CONTEXT_PATH env var #3

merged 4 commits into from Apr 1, 2016

Conversation

ghost
Copy link

@ghost ghost commented Mar 12, 2016

Hi. This PR would close #2.

Here is my container which I built using the Dockerfile in this PR.

https://hub.docker.com/r/josdotso/archiva-docker-prefixed/

Please note that the sed for ARCHIVA_CONTEXT_PATH only alters the configuration of the untar'ed Archiva source. If a previous config directory exists it will not be altered by this PR.

I tested that it works earlier this evening with Nginx reverse proxy config shown below.

# For more information on configuration, see:
#   * Official English Documentation: http://nginx.org/en/docs/
#   * Official Russian Documentation: http://nginx.org/ru/docs/

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

events {
    worker_connections 1024;
}

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    # include /etc/nginx/conf.d/*.conf;

    server {
        listen       443;
    server_name  example.org;

        ssl on;
        ssl_certificate      /etc/nginx/ssl/nginx.crt;
        ssl_certificate_key  /etc/nginx/ssl/nginx.key;
    ssl_session_cache  builtin:1000  shared:SSL:10m;
    ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers  HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
    ssl_prefer_server_ciphers  on;

    access_log  /var/log/nginx/archiva.access.log;

    location ^~  /archiva/ {
        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;
        # Fix the “It appears that your reverse proxy set up is broken" error.
        proxy_read_timeout  90;
        proxy_pass          http://archiva.service.consul:4707/archiva/;
    }
    }
}

@benjamin-heasly
Copy link
Owner

Nice one. LGTM. 👍

Thanks for the PR!

Sorry for the delay.

@benjamin-heasly benjamin-heasly merged commit 53f7e42 into benjamin-heasly:master Apr 1, 2016
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.

Reverse proxy prefix
1 participant