sohotcall

Debian OpenVPN Apache reverse proxy for internet to local computer

Sep 2nd, 2020
104
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. BEFORE: "Setting OpenVPN Debian"[https://pastebin.com/HFbRhGWm]
  2.  
  3. $ sudo a2enmod proxy proxy_http proxy_connect
  4. $ sudo nano /etc/apache2/mods-enabled/proxy.conf
  5.  
  6. #####
  7. <IfModule mod_proxy.c>
  8. # If you want to use apache2 as a forward proxy, uncomment the
  9. # 'ProxyRequests On' line and the <Proxy *> block below.
  10. # WARNING: Be careful to restrict access inside the <Proxy *> block.
  11. # Open proxy servers are dangerous both to your network and to the
  12. # Internet at large.
  13. #
  14. # If you only want to use apache2 as a reverse proxy/gateway in
  15. # front of some web application server, you DON'T need
  16. # 'ProxyRequests On'.
  17. # ProxyRequests On
  18.  
  19. ProxyRequests Off
  20. <Proxy *>
  21. AddDefaultCharset off
  22. # Require all denied
  23. Order deny,allow
  24. Allow from all
  25. #Require local
  26. </Proxy>
  27. ProxyPass /yourapp/ http://10.8.0.6/yourapp/
  28. ProxyPassReverse /yourapp/ http://10.8.0.6/yourapp/
  29. <Location /yourapp/ >
  30. ProxyPassReverse /
  31. Order deny,allow
  32. Allow from all
  33. </Location>
  34. # Header edit Location ^http://10.8.0.6/yourapp/ https://10.8.0.6/yourapp/
  35.  
  36. # Enable/disable the handling of HTTP/1.1 "Via:" headers.
  37. # ("Full" adds the server version; "Block" removes all outgoing Via: headers)
  38. # Set to one of: Off | On | Full | Block
  39. #ProxyVia Off
  40. </IfModule>
  41. # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
  42. #####
  43.  
  44. $ sudo systemctl restart apache2
RAW Paste Data