CSS

Wednesday, August 25, 2021

403 Response to My Developer Box

So I had a perfectly working setup. I could call my machine's end point no problem. When I had a outside service use the service as a callback they got 403 Unauthorized. 

 It looks like it was my ISP. I'm guessing this since the call never hit my Apache server. 

 How I fixed it. 

 tldr; I created an Apache Server in AWS and proyied through there. I have a AWS enviornment which includes a Windows RRAS VPN. I connect to AWS through the VPN. 

I am just going to give an overview of what I did.  I expect you to know about Windows VPN and Linux.

  Steps 

 since I am using Windows RRAS VPN I can NAT all http calls to my machine.

Go to your domain server and go to the Dial-up and set a static IP address for yourself.

Go to Routing and Remote Access Manager on the VPN server.


Under Services and Port Tab choose HTTP  set the destination IP to the one you choose for yourself.

Make sure your VPN server is in a security group that allows http access.

In AWS \create a micro instance using your favorite Linux.

ssh into your machine

Install Apache

enable mod proxy

sudo a2nenmod proxy


Since you are NATed througj the VPN server you need to setup a proxy to it


ProxyPass "/"  "http://10.0.0.204/"

<Location "/.well-known/">

    ProxyPass "!"

</Location>


Make sure you exclude the .well-known directory so you can get an SSL Cert from Letsencypt.


Have fun