Project

Profile

Help

Issue #7471

closed

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

Added by mdepaulo@redhat.com over 4 years ago. Updated about 4 years 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 - CURRENTRELEASEdkliban@redhat.comActions
Actions #1

Updated by fao89 over 4 years ago

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

Updated by bmbouter over 4 years ago

  • Priority changed from Normal to High
Actions #3

Updated by bmbouter over 4 years 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>
Actions #4

Updated by bmbouter over 4 years ago

  • Status changed from NEW to ASSIGNED
Actions #5

Updated by mdepaulo@redhat.com over 4 years 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/
Actions #6

Updated by mdepaulo@redhat.com over 4 years ago

  • Category deleted (Installer - Moved to GitHub issues)
  • 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.

Actions #7

Updated by rchan over 4 years ago

  • Sprint changed from Sprint 81 to Sprint 82

Added by bmbouter over 4 years ago

Revision 1ef9214d | View on GitHub

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

Actions #8

Updated by pulpbot over 4 years ago

  • Status changed from ASSIGNED to POST
Actions #9

Updated by bmbouter over 4 years ago

  • Status changed from POST to MODIFIED
Actions #10

Updated by pulpbot about 4 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF