How to access default site and website/webpage with port number - nginx

I have one website with https for example https://mywebsite.com. This website is working fine properly. Now one fast api app is provided to host on the same website.
I deployed the fast api which is accessible on Server_IP:8000.
How can i access this fast api under website/domain name https://mywebsite.com that also under ssl certificate. I also want to disable exposure to port No. 8000 on which fast api is working.
I m using ubuntu 20.04 & nginx. Please correct me if there is any gap or if I am missing something. I am New in the filed of DevOps.

Related

Unable to direct Route53 records to new server

I am trying to point a domain from a website (radicalxchange.org) currently hosted by Firebase to a new version hosted in a Digital Ocean droplet. The name servers are managed by AWS Route53. When I change the A record in Route53 to my D.O. droplet IP address (167.99.59.52), the site immediately stops loading. I've tried to wait a few hours but it never connects.
I should note that Route53 contains a lot of other stuff related to our site (CNAME, MX & TXT records) however I've been under the impression that the only thing necessary to route website traffic to the new IP is the A record. What am I doing wrong?
Well, your Digital Ocean droplet is kind of misconfigured:
1) from current hosting, you have permanent redirect to https (and if your browser have that already cached, it will immediately go to https://radicalxchange.org), and you don't have https configured in your new hosting
2) Even if you use clean browser, your new http://radicalxchange.org will redirect you to http://167.99.59.52/, which is quite strange.
I suggest you hardcode 167.99.59.52 radicalxchange.org entry in your hosts file, and test thoroughly, and only then make DNS changes.

How to properly add SSL certificate from openSSL in localhost using Xammp and Wordpress with 8080 port

I am trying to build an application that will communicate with WooCommerce via WordPress. For this purpose I have decided to use WordPress REST API plugin which requires me to genarate WooCommerce API key in order to communicate with my app.But when I press the generate key on WooCommerce settings page, nothing happens.
So I did some researches and came to know that I have to work on a protected site in order to acheive it (https). Only issue I am working on a localhost using Xammp and in order to make Xammp work on my machine I had to set my localhost on the 8080 port. so when I connect to my localhost I write http://localhost:8080/wordpress/. Since I don't yet want to spend on the project I followed instruction from this link in order to create my openSSL certificate. One thing to notice is that I set localhost:8080/wordpress as my common name in the certificate. I don't know if that was a good choice.
Then, following instruction from this other link, I have enabled the new certificate on a Server and set my site to work on https. Only issue is that I get an error from xammp saying "Error: Apache shutdown unexpectedly. This may be due to a blocked port, missing dependencies..." when I start appache and if I call http://localhost:443/wordpress/ it says Bad request!. Can someone help please??

Url rewriting with Charles Proxy in order to run a wordpress site over a LAN?

I want to use Charles Proxy to share a local development PC's web server where I am developing sites on so that I can access the PC over my LAN to test on various mobile devices.
Having setup the correct ip address of my PC in the http proxy settings on various tablets they can all connect to the PC and this works fine.
The issue is that I need to test a wordpress site and as anyone that uses wordpress knows, it generates full url links between each page it serves. As the site normally runs on my PC the urls it generates are all http://localhost/wordpress/pagename.
So the issue is that if I access the same site from a remote device via the proxy (addressing http://192.168.1.200/wordpress/) it instantly redirects me to http://localhost/wordpress/pagename url in the mobile device and this fails to load as the tablet can't determine "localhost" correctly.
There must be a way of using one of Charles' various options to resolve this but I can't for the life of me work out which. I've tried remote maps and DNS spoofing but no joy.
Note, I'm completely aware that you can with SQL commands change the urls throughout a wordpress database but I just wanted to see if this was possible without undertaking this step as it would be a lot more flexible if I don't have to do that each time I want to preview sites via my other local LAN devics.
You can use Charles proxy feature called Rewrite Tool. I assume your local network uses 192.168.168.X IPs.
Enable rewrite
Add new rule and name it as you wish
To Locations section add Protocol: http and Host: 192.168.168.X
To Rules section add Type: body, Where: response, Match: localhost, Replace: 192.168.168.X
It may require some more tinkering but i hope you get the idea

For an app hosted on meteor.com, would it be reasonable to use a proxy to add SSL and a custom domain?

First, let me explain why. I've had some rough luck with third party meteor hosting providers. But I'd really rather not run my own servers (I have a meteor app running with SSL on digital ocean, so I know how to do that, I just would rather dedicated professionals run as much of my infrastructure as possible). From what I can see, meteor.com hosting is wonderful, with the caveat of not being able to have a custom domain with ssl.
So, would it make sense to put up an nginx server that just proxied https://example.com to https://example.meteor.com? For starters, would that work, and if it did, would it be performant?
For your info, Meteor has a roadmap to roll out Galaxy (managed "meteor deploy" to your own servers) in list Under consideration for 1.1+. And it should be a perfect choice for you. Here is their Trello
This is MDG's commercial product -- a managed cloud platform for
deploying Meteor apps. You have control of the underlying hardware
(you own the servers or the EC2 instances, and Galaxy manages them for
you).
General Availability for Galaxy will be sometime after 1.0, since we
want to focus on Meteor 1.0 and get it out as quickly as possible.
So in the mean time if you just care about using your own domain, you can use something like Domain name forwarding which lets you automatically direct your domain name's visitors to a different website. And Masking prevents visitors from seeing your domain name forwarding by keeping your domain name in the Web browser's address bar.
Also in your case, you don't necessarily need to add SSL as Meteor has already got one when you deploy your apps. Just try input the url in your browser with https://yourappnamehere.meteor.com and you can see a SSL certificate is already in place.

Windows Azure VM SSL and Cloudapp.net

I installed an ASP.net application on a windows Azure VM (IIS 7). SSL certificate is installed, configured and the application works correctly. I have removed Http binding and http endpoints.
The issue I am having is that if I use the cloudapp.net link (using https), the application still opens with a mismatched certificate.
What can I do to deny any user from opening my application using https://xx.cloudapp.net/x?
It seems really silly that people are saying this isn't the right place for this question, since some of the solutions could be code related. ie: In your application, check the host and if it's cloudapp.net, do a URL redirect.
There's a few different options here but it sounds like what you're looking for is just the ability to prevent someone from viewing the application using that URL.
What I would do is set up a site in IIS that uses Host Header resolution to look for xx.cloudapp.net. If that URL is recognized, do a redirect using the HTTP redirect settings to the https version of your app. Don't bind the SSL port to this site or you'll run into SSL errors like you showed above.
The other option is to leave it out entirely and simply use the Host Header resolution to filter out requests for your site. I suspect what you've done is assign all incoming requests to the only IP address on the system, which is why the xx.cloudapp.net is showing your app and the cert is failing.
This would cause xx.cloudapp.net to fail to show any site at all but I think that might be what you want to do anyway.

Resources