should I run nodejs in http2 when nginx is host http2 - node.js

I was running Web App on NodeJS v8.4 to try http2.
I run some test and found out some interesting result.
Here is three test scenario:
nginx listen 443 ssl http2 <--> redirect to nodejs run http2
nginx listen 443 ssl http2 <--> redirect to nodejs run http
nginx listen 443 ssl <--> redirect to nodejs run http
I open chrome dev tool to check which protocol is used when loading resources.
The result is first two methods all run in http2 and Waterfall is almost the same.
The last one is run in http1.1 and the waterfall is as expected
I wana make sure if I need to run NodeJS in http2 when nginx is host in http2

Related

Cannot get AWS Elastic Beanstalk single instance (no load balancer) to listen on 443

No matter what I do I cannot get my application to listen on port 443 (https). I simply need nginx to forward traffic to my app which is running https on port 8080, but nginx will only listen on port 80 and will refuse to forward to my app unless it is also running on port 80.
I've followed the instructions in this article but it makes no difference.
I do not have a domain name yet, I am simply using a self signed cert so I don't believe certbot will help here.
Please help I am so frustrated hahaaaaaa

Nginx Proxy Manager (Docker) + mail server

im having a server running ubuntu with docker.
I have a docker instance running Nginx Proxy Manager to serve my multiple domains.
I want to run a mail server but since Nginx is using port 443 for HTTPS and 80 for HTTP i cant install any docker image's since they make use of both 80 and 443.
Example https://poste.io/doc/getting-started#download its also make use of the same ports.
Any idea how to have a single IP and host both web and mail?

Use Reverse Proxy from Https client to Http server running locally on my machine

I have a published site that uses HTTPS. The site needs to communicates with a HTTP node Express API. The API is run on my local machine. Everything worked fine until I switched the client application to use HTTPS. Now I receive mixed content warnings. I have been reading about reverse proxys and wonder if this could be the solution to my problem. Is it possible to proxy a request to my localhost? Or will localhost point to the server the proxy is on?
I have been looking at using nginx as the reverse proxy server but I have zero experience with proxys and not positive how to go about it.
I am mainly wondering if it is possible or not before I dig any deeper.
Yes, this is a pretty standard use case for using nginx (or any other reverse proxy). You would configure the location prefixes, etc that need to go to your backend application and proxy (via proxy_pass directive) to them. Any static content can be served directly from nginx. All of this can then behind nginx.
Assuming that your application is never issuing absolute urls which make use of "http://" this should resolve your mixed content warnings.
You will probably want to read some tutorials but the basics of your configuration would be:
server {
listen 443 ssl; # you can also add http2
server_name hostnames that you listen for;
ssl_certificate_key /path/to/cert.key;
ssl_certificate /path/to/cert.pem;
root /var/www/sites/foo.com;
location /path/handled/by/application {
proxy_pass http://localhost:8000; # or whatever port is
}
}

Application working on http but not on https

Background: I have two backend instances running haproxy, apache, nodejs on ports 4000 and 8007 for haproxy, 80 for httpd, 3000 3007 3012 running node. I have a staging site which is running on this instance. I have signed certificate installed at ELB level and ELB listening on https 443 port to backend http 80 port.
Issue: When I tried to login to the stating url with http then the backend is working fine on port 80 and 3000, network flow logs also returning status code as Ok for request to http://stating _url:3000. But when I tried to access site on https then I am getting status as "blocked:mixed-content" for https://stating _url:3000 request. Please refer to below screenshots
Below is output for http which is working as expected
Below is the output for https which is not working as expected
I tried different protocols for listeners at ELB level. I dont understand why ELB on port 80 sends request to port 80 on backend server and all works fine but same ELB on port 443 sends request to same port 80 on backend server but fails to establish connection with 3000.

How do I use HTTPS port on clould9 ide?

I am just running some tests on c9.io - but I am stuck on how to get the HTTPS server to run.
I am using the port given in process.env.PORT which links up to the browser in c9, but there doesn't seem to an HTTPS port. In a local environment I use port 3001 for HTTPS.
The Cloud9 workspaces don't support custom SSL certificates yet so you won't be able to start an HTTPS server from there, but your http server running on 0.0.0.0:8080 will be accessible via both HTTP and HTTPS.

Resources