Project

Profile

Help

Issue #7471

As a plugin developer, I can ship a webserver snippet that overrides a URL under /pulp/api/v3/

Added by mdepaulo@redhat.com about 1 month ago. Updated 28 days ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Documentation
Sprint:
Sprint 82
Quarter:

Description

galaxy_ng needs to be able to override how the webservers handle the URL: /pulp/api/v3/pulp_ansible/ It must no be sent to gunicorn, but that is what our webserver config files do for /pulp/api/v3/

galaxy_ng currently uses nginx, but presumably wants to use apache also.

For nginx:


Related issues

Related to Pulp - Issue #7481: Pulp 3 webserver config overwrites Pulp2 configCLOSED - CURRENTRELEASE<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision 1ef9214d View on GitHub
Added by bmbouter about 1 month ago

Adds docs on reverse proxy url customization

The snippets feature of plugins can be used to customize the behavior of the reverse proxy by including "more specific" routes that take precedence over less-specific routes the installer provides.

closes #7471

History

#1 Updated by fao89 about 1 month ago

  • Related to Issue #7481: Pulp 3 webserver config overwrites Pulp2 config added

#2 Updated by bmbouter about 1 month ago

  • Priority changed from Normal to High

#3 Updated by bmbouter about 1 month ago

I think plan A will work for both nginx and apache maybe?

Then for galaxy_ng to disallow pulp_ansible urls they would have their snippet for nginx for example have:

        location /pulp/api/v3/remotes/ansible/ {
            return 404;
        }

Prior to adding the above snippet on my system I can run http --verify=no https://localhost/pulp/api/v3/remotes/ansible/collection/ and I get

HTTP/1.1 200 OK
Allow: GET, POST, HEAD, OPTIONS
Connection: keep-alive
Content-Length: 52
Content-Type: application/json
Date: Thu, 17 Sep 2020 18:06:48 GMT
Server: nginx/1.18.0
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN

{
    "count": 0,
    "next": null,
    "previous": null,
    "results": []
}

After adding in the nginx config above (below the /pulp/api/v3/ part even) I run http --verify=no https://localhost/pulp/api/v3/remotes/ansible/collection/, and I receive:

HTTP/1.1 404 Not Found
Connection: keep-alive
Content-Length: 153
Content-Type: text/html
Date: Thu, 17 Sep 2020 18:09:05 GMT
Server: nginx/1.18.0

<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.18.0</center>
</body>
</html>

#4 Updated by bmbouter about 1 month ago

  • Status changed from NEW to ASSIGNED

#5 Updated by mdepaulo@redhat.com about 1 month ago

bmbouter wrote:

I think plan A will work for both nginx and apache maybe?

Then for galaxy_ng to disallow pulp_ansible urls they would have their snippet for nginx for example have:

        location /pulp/api/v3/remotes/ansible/ {
            return 404;
        }

Thank you very much. I verified it (but couldn't setup authentication with .netrc and curl, so I tried auth failed as the redirect happening to the app.)

I managed to acheive the same behavior with apache using the following snippet file:

  # Disable ProxyPass & ProxyPassReverse so that the Redirect can work.
  <Location "/pulp/api/v3/remotes/ansible/">
    AllowOverride None # This line may not be necessary
    ProxyPass "!"
    ProxyPassReverse "!"
  </Location>

  Redirect 404 /pulp/api/v3/remotes/ansible/

#6 Updated by mdepaulo@redhat.com about 1 month ago

  • Category deleted (Installer)
  • Assignee changed from mdepaulo@redhat.com to bmbouter
  • Tags Documentation added

Converting to a docs ticket, and removing from the installer. Since it will be in the developer docs.

#7 Updated by rchan about 1 month ago

  • Sprint changed from Sprint 81 to Sprint 82

#8 Updated by pulpbot about 1 month ago

  • Status changed from ASSIGNED to POST

#9 Updated by bmbouter about 1 month ago

  • Status changed from POST to MODIFIED

#10 Updated by pulpbot 28 days ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF