mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-11-17 07:45:52 +01:00
81f367f4b2
* New translations uplinks.md (Chinese Simplified) docs(website): new translations * New translations uplinks.md (Chinese Simplified) docs(website): new translations * New translations what-is-verdaccio.md (Chinese Simplified) docs(website): new translations * New translations config.md (Chinese Simplified) docs(website): new translations * New translations plugins.md (Chinese Simplified) docs(website): new translations * New translations config.md (Chinese Simplified) docs(website): new translations * New translations what-is-verdaccio.md (Chinese Simplified) docs(website): new translations * New translations windows.md (Chinese Simplified) docs(website): new translations * New translations dev-plugins.md (Chinese Simplified) docs(website): new translations * New translations dev-plugins.md (Chinese Simplified) docs(website): new translations * New translations dev-plugins.md (Chinese Simplified) docs(website): new translations * New translations dev-plugins.md (Chinese Simplified) docs(website): new translations * New translations dev-plugins.md (Chinese Simplified) docs(website): new translations * New translations docker.md (Chinese Simplified) docs(website): new translations * New translations docker.md (Chinese Simplified) docs(website): new translations * New translations docker.md (Chinese Simplified) docs(website): new translations * New translations docker.md (Chinese Simplified) docs(website): new translations * New translations docker.md (Chinese Simplified) docs(website): new translations * New translations contributing.md (Spanish) docs(website): new translations * New translations contributing.md (Chinese Simplified) docs(website): new translations * New translations contributing.md (Portuguese, Brazilian) docs(website): new translations * New translations config.md (Spanish) docs(website): new translations * New translations web.md (Portuguese, Brazilian) docs(website): new translations * New translations web.md (Spanish) docs(website): new translations * New translations config.md (Chinese Simplified) docs(website): new translations * New translations config.md (Portuguese, Brazilian) docs(website): new translations * New translations web.md (Chinese Simplified) docs(website): new translations * New translations install.md (Chinese Simplified) docs(website): new translations * New translations node-api.md (Chinese Simplified) docs(website): new translations * New translations contributing.md (Chinese Simplified) docs(website): new translations * New translations web.md (Chinese Simplified) docs(website): new translations * New translations packages.md (Chinese Simplified) docs(website): new translations * New translations plugins.md (Spanish) docs(website): new translations * New translations plugins.md (Portuguese, Brazilian) docs(website): new translations * New translations plugins.md (Chinese Simplified) docs(website): new translations * New translations ansible.md (Polish) docs(website): new translations * New translations repositories.md (Polish) docs(website): new translations * New translations chef.md (Polish) docs(website): new translations * New translations puppet.md (Polish) docs(website): new translations * New translations ci.md (Polish) docs(website): new translations * New translations what-is-verdaccio.md (Polish) docs(website): new translations * New translations node-api.md (Polish) docs(website): new translations * New translations windows.md (Polish) docs(website): new translations * New translations web.md (Polish) docs(website): new translations * New translations use-cases.md (Polish) docs(website): new translations * New translations uplinks.md (Polish) docs(website): new translations * New translations test.md (Polish) docs(website): new translations * New translations ssl.md (Polish) docs(website): new translations * New translations server.md (Polish) docs(website): new translations * New translations reverse-proxy.md (Polish) docs(website): new translations * New translations protect-your-dependencies.md (Polish) docs(website): new translations * New translations auth.md (Polish) docs(website): new translations * New translations plugins.md (Polish) docs(website): new translations * New translations packages.md (Polish) docs(website): new translations * New translations notifications.md (Polish) docs(website): new translations * New translations logger.md (Polish) docs(website): new translations * New translations kubernetes.md (Polish) docs(website): new translations * New translations install.md (Polish) docs(website): new translations * New translations iis-server.md (Polish) docs(website): new translations * New translations docker.md (Polish) docs(website): new translations * New translations dev-plugins.md (Polish) docs(website): new translations * New translations contributing.md (Polish) docs(website): new translations * New translations config.md (Polish) docs(website): new translations * New translations cli.md (Polish) docs(website): new translations * New translations build.md (Polish) docs(website): new translations * New translations en.json (Polish) docs(website): new translations
88 lines
2.3 KiB
Markdown
88 lines
2.3 KiB
Markdown
---
|
|
id: reverse-proxy
|
|
title: "Reverse Proxy Setup"
|
|
---
|
|
## Apache
|
|
|
|
Apache and mod_proxy should not decode/encode slashes and leave them as they are:
|
|
|
|
<VirtualHost *:80>
|
|
AllowEncodedSlashes NoDecode
|
|
ProxyPass /npm http://127.0.0.1:4873 nocanon
|
|
ProxyPassReverse /npm http://127.0.0.1:4873
|
|
</VirtualHost>
|
|
|
|
|
|
### Configuration with SSL
|
|
|
|
config.yaml
|
|
|
|
```yaml
|
|
url_prefix: https://npm.your.domain.com
|
|
```
|
|
|
|
Apache virtual server configuration
|
|
|
|
apacheconfig
|
|
<IfModule mod_ssl.c>
|
|
<VirtualHost *:443>
|
|
ServerName npm.your.domain.com
|
|
SSLEngine on
|
|
SSLCertificateFile /etc/letsencrypt/live/npm.your.domain.com/fullchain.pem
|
|
SSLCertificateKeyFile /etc/letsencrypt/live/npm.your.domain.com/privkey.pem
|
|
SSLProxyEngine On
|
|
ProxyRequests Off
|
|
ProxyPreserveHost On
|
|
AllowEncodedSlashes NoDecode
|
|
ProxyPass / http://127.0.0.1:4873 nocanon
|
|
ProxyPassReverse / http://127.0.0.1:4873
|
|
</VirtualHost>
|
|
</IfModule>
|
|
|
|
|
|
## Nginx
|
|
|
|
server {
|
|
listen 80 default_server;
|
|
location / {
|
|
proxy_pass http://127.0.0.1:4873/;
|
|
proxy_set_header Host $host;
|
|
}
|
|
}
|
|
|
|
|
|
## Run behind reverse proxy with different domain and port
|
|
|
|
If you run verdaccio behind reverse proxy, you may noticed all resource file served as relaticve path, like `http://127.0.0.1:4873/-/static`
|
|
|
|
To resolve this issue, you should send real domain and port to verdaccio with `Host` heade
|
|
|
|
Nginx configure should look like this:
|
|
|
|
```nginx
|
|
location / {
|
|
proxy_pass http://127.0.0.1:4873/;
|
|
proxy_set_header Host $host:$server_port;
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
```
|
|
|
|
For this case, `url_prefix` should NOT set in verdaccio config
|
|
|
|
* * *
|
|
|
|
or a sub-directory installation:
|
|
|
|
```nginx
|
|
location ~ ^/verdaccio/(.*)$ {
|
|
proxy_pass http://127.0.0.1:4873/$1;
|
|
proxy_set_header Host $host:$server_port;
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
```
|
|
|
|
For this case, `url_prefix` should set to `/verdaccio/`
|
|
|
|
> Note: There is a Slash after install path (`https://your-domain:port/vardaccio/`)! |