Skip to content

Instantly share code, notes, and snippets.

@fedesilva
Created September 4, 2012 00:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fedesilva/3615270 to your computer and use it in GitHub Desktop.
Save fedesilva/3615270 to your computer and use it in GitHub Desktop.
Artifactory behind nginx
upstream artifacts {
server 127.0.0.1:8081 fail_timeout=0;
}
server {
listen 80;
root /var/www;
server_name artifacts.inconcert artifacts;
access_log /var/log/nginx/artifacts_access.log;
error_log /var/log/nginx/artifacts_error.log;
client_max_body_size 5m;
location / {
rewrite ^/(.*)$ http://artifacts.inconcert/artifactory? break;
}
location /artifactory/ {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;
proxy_pass http://artifacts/artifactory/;
}
}
@Tombar
Copy link

Tombar commented Sep 4, 2012

Line 27: proxy_pass http://artifacts/artifactory/;

no debería ser al final proxy_pass http://artifacts/;

@fedesilva
Copy link
Author

nopes, así anduvo bien.

aparentemente si el location dice /artifactory/ no se lo pasa al upstream, por lo que tengo que pasarselo yo.

@fedesilva
Copy link
Author

updated: client_max_body_size para poder realmente subir jars :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment