Advertisement
Guest User

apache2 reverse proxy

a guest
Nov 13th, 2023
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. <VirtualHost *:80>
  2. ServerAdmin [email protected]
  3. ServerName netbox.public.com
  4.  
  5. <Proxy *>
  6. Require all granted
  7. </Proxy>
  8.  
  9. ProxyPass "/" "http://10.0.0.61/"
  10. ProxyPassReverse "/" "http://10.0.0.61/"
  11.  
  12. ProxyPreserveHost On
  13. ProxyAddHeaders Off
  14. RequestHeader set X-Forwarded-For "expr=%{REMOTE_ADDR}"
  15. RequestHeader set X-Forwarded-Proto "https"
  16.  
  17. RewriteEngine on
  18. RewriteCond %{SERVER_NAME} =netbox.public.com
  19. RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
  20. </VirtualHost>
  21. <IfModule mod_ssl.c>
  22. <VirtualHost *:443>
  23. ServerAdmin [email protected]
  24. ServerName netbox.public.com
  25. SSLEngine on
  26.  
  27. <Proxy *>
  28. Require all granted
  29. </Proxy>
  30.  
  31. ProxyPass "/" "http://10.0.0.61/"
  32. ProxyPassReverse "/" "http://10.0.0.61/"
  33.  
  34. ProxyPass /netbox/admin http://10.0.0.61:8000
  35. ProxyPassReverse /netbox/admin http://10.0.0.61:8000
  36.  
  37.  
  38. ProxyPass /netbox http://10.0.0.61:8000
  39. ProxyPassReverse /netbox http://10.0.0.61:8000
  40.  
  41. ProxyPass /admin http://10.0.0.61:8000/admin
  42. ProxyPassReverse /admin http://10.0.0.61:8000/admin
  43.  
  44. ProxyPass /static http://10.0.0.61:8000/static
  45. ProxyPassReverse /static http://10.0.0.61:8000/static
  46.  
  47. ProxyPreserveHost On
  48. ProxyAddHeaders Off
  49. RequestHeader set X-Forwarded-For "expr=%{REMOTE_ADDR}"
  50. RequestHeader set X-Forwarded-Proto "https"
  51. Include /etc/letsencrypt/options-ssl-apache.conf
  52. SSLCertificateFile /etc/letsencrypt/live/netbox.public.com/fullchain.pem
  53. SSLCertificateKeyFile /etc/letsencrypt/live/netbox.public.com/privkey.pem
  54. </VirtualHost>
  55. </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement