Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

128
Views
Configure local proxy for the npm audit with Apache

Based on this one https://github.com/chovyy/npm-audit-proxy

In this case Nexus OSS v3 manager running behind Apache reverse proxy. There is need to proxy npm audit as well from https://registry.npmjs.org/-/npm/v1/security/audits/.

So how to configure properly Apache to pass npm adit call to https://registry.npmjs.org/-/npm/v1/security/audits/

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

This Apache configuration worked in my case.

<VirtualHost 0.0.0.0:443>
  ServerName nexus.corporate.domain

  SSLEngine on
  SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
  SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1 -TLSv1.2
  SSLHonorCipherOrder On
  SSLCompression off
  SSLCertificateFile /etc/ssl/localcerts/nexus/nexus.pem
  SSLCertificateKeyFile /etc/ssl/localcerts/nexus/nexus.key
  SSLCertificateChainFile /etc/ssl/localcerts/nexus/Local_Corporate_CA_chain.crt

  SSLSessionTickets   off
  SSLProxyEngine On

  ProxyPass /repository/npm-public/-/npm/v1/security/audits https://registry.npmjs.org/-/npm/v1/security/audits
  ProxyPassReverse /repository/npm-public/-/npm/v1/security/audits https://registry.npmjs.org/-/npm/v1/security/audits
  ProxyPass         /  http://127.0.0.1:8081/ nocanon
  ProxyPassReverse  /  http://127.0.0.1:8081/
  ProxyRequests     Off
  ProxyPreserveHost Off
  AllowEncodedSlashes on

  RequestHeader set X-Forwarded-Proto "https"
  RequestHeader set X-Forwarded-Port "443"

  <Proxy http://127.0.0.1:8081/*>
    Order allow,deny
    Allow from all
  </Proxy>

  ErrorLog /var/log/apache2/nexus_apache_error.log
  CustomLog /var/log/apache2/nexus_apache_access.log common

</VirtualHost>

I had error Forbidde 403 but it was caused by ProxyPreserveHost on. Changed it to ProxyPreserveHost off

/repository/npm-public/ is npm group type repository created in nexus. https://nexus.corporate.domain/repository/npm-public/

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!