abhinavsingh/proxy.py

421 Error With Apache

agieocean opened this issue · 2 comments

Describe the bug
When doing a proxy request with proxy.py reverse proxied with Apache I get a 421 error.

To Reproduce
Create a virtual hosts record reverse proxying proxy.py to a domain name with ssl like this:

<VirtualHost *:443>

Header set Access-Control-Allow-Origin "*"
    Header set Access-Control-Allow-Methods "GET,POST,PUT,DELETE,OPTIONS"
    Header set Access-Control-Allow-Headers "Content-Type,Authorization,X-Requested-With"
    Header set Access-Control-Allow-Credentials "true"

   ServerName cors.y232.home
   ServerAlias cors.y232.home
 SSLEngine on
SSLProxyEngine On
   SSLCertificateFile /etc/ssl/certs/cors.y232.home.crt
   SSLCertificateKeyFile /etc/ssl/certs/cors.y232.home.key
ProxyRequests Off
ProxyPass / http://127.0.0.1:8899/
    ProxyPassReverse / http://127.0.0.1:8899/

</VirtualHost>

Then curl -x https://domain https://desireddomain

Expected behavior
Return the proxied request

Version information

  • OS: Ubuntu
  • Device: VM
  • proxy.py Version: latest stable as provided by Docker (as of writing)

Additional context
I dont see the request going through in debug so I think this is an issue with my Apache configuration, Im open to other alternatives but Im trying to use this as a cors proxy so I do need it to have SSL and a domain

@agieocean I haven't used Apache in decades, hence I cannot vouch for correctness of this config. But, I use proxy.py to send traffic to nginx based services all the time and I haven't faced such issues yet. Since you are getting 421, I suspect its more to do with Apache configuration?