Repository navigation
Bug 1849943: Add Apache and Nginx reverse proxy instructions #190
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
Open
topunix
wants to merge
3
commits into
bugzilla:main
Choose a base branch
from
topunix:bug-1849943
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| .. This document is shared among all non-Windows OSes. | ||
|
|
||
| .. _nginx: | ||
|
|
||
| Nginx | ||
| ##### | ||
|
|
||
| Bugzilla runs as its own web application. Nginx is used as a reverse | ||
| proxy in front of it and can also handle TLS. | ||
|
|
||
| Add a server block for your Bugzilla hostname. On Debian and Ubuntu use | ||
| :file:`/etc/nginx/sites-available/bugzilla`; on Fedora and Red Hat use | ||
| :file:`/etc/nginx/conf.d/bugzilla.conf`: | ||
|
|
||
| .. code-block:: nginx | ||
|
|
||
| server { | ||
| listen 80; | ||
| server_name bugzilla.example.org; | ||
|
|
||
| client_max_body_size 10m; | ||
|
|
||
| location / { | ||
| proxy_pass http://127.0.0.1:3001; | ||
| proxy_set_header Host $host; | ||
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
| proxy_set_header X-Forwarded-Proto $scheme; | ||
| } | ||
| } | ||
|
|
||
| On Debian and Ubuntu, enable the site: | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| sudo ln -s /etc/nginx/sites-available/bugzilla /etc/nginx/sites-enabled/ | ||
|
|
||
| Then reload Nginx with ``sudo systemctl reload nginx``. | ||
|
|
||
| If Nginx terminates TLS, serve Bugzilla from a ``443`` server block and | ||
| redirect plain HTTP to it. The ``X-Forwarded-Proto $scheme`` header above | ||
| already tells Bugzilla to generate ``https`` URLs. Tools such as Certbot can | ||
| generate this configuration and the certificates for you. | ||
|
|
||
| .. code-block:: nginx | ||
|
|
||
| server { | ||
| listen 443 ssl; | ||
| listen [::]:443 ssl; | ||
| server_name bugzilla.example.org; | ||
|
|
||
| ssl_certificate /etc/letsencrypt/live/bugzilla.example.org/fullchain.pem; | ||
| ssl_certificate_key /etc/letsencrypt/live/bugzilla.example.org/privkey.pem; | ||
|
|
||
| client_max_body_size 10m; | ||
|
|
||
| location / { | ||
| proxy_pass http://127.0.0.1:3001; | ||
| proxy_set_header Host $host; | ||
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
| proxy_set_header X-Forwarded-Proto $scheme; | ||
| } | ||
| } | ||
|
|
||
| server { | ||
| listen 80; | ||
| listen [::]:80; | ||
| server_name bugzilla.example.org; | ||
| return 301 https://$host$request_uri; | ||
| } | ||
|
|
||
| .. note:: | ||
| Nginx rejects request bodies larger than 1 MB by default, which blocks | ||
| larger attachment uploads. Set ``client_max_body_size`` to at least the | ||
| value of the :param:`maxattachmentsize` parameter. | ||
|
|
||
| .. note:: | ||
| Bugzilla listens on port 3001 by default. Set the ``PORT`` environment | ||
| variable to change it, and update ``proxy_pass`` to match. Start the | ||
| web app using ``MOJO_REVERSE_PROXY=1 ./bugzilla.pl daemon`` when | ||
| running behind Nginx, so it trusts the forwarded headers. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.