GithubHelp home page GithubHelp logo

Comments (4)

sandrocsimas avatar sandrocsimas commented on August 21, 2024

This is my nginx configuration:

server {
  listen      80;
  server_name closic.com;
  return      301 https://www.closic.com$request_uri;
}

server {
  listen      80;
  server_name ~^(?<subdomain>.+)\.closic\.com$;
  return      301 https://$subdomain.closic.com$request_uri;
}

server {
  listen      443 ssl;
  server_name www.closic.com;
  ssl_certificate     /usr/local/nginx/ssl/www.closic.com/server.chained.crt;
  ssl_certificate_key /usr/local/nginx/ssl/www.closic.com/server.key;

  location / {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-NginX-Proxy true;
    proxy_set_header Host $http_host;
    proxy_pass       http://127.0.0.1:4000;
    proxy_redirect   off;
  }
}

server {
  listen      443 ssl;
  server_name api.closic.com;
  ssl_certificate     /usr/local/nginx/ssl/api.closic.com/server.chained.crt;
  ssl_certificate_key /usr/local/nginx/ssl/api.closic.com/server.key;

  location / {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-NginX-Proxy true;
    proxy_set_header Host $http_host;
    proxy_pass       http://127.0.0.1:3000;
    proxy_redirect   off;
  }
}

server {
  listen      3101 ssl;
  server_name api.closic.com;
  ssl_certificate     /usr/local/nginx/ssl/api.closic.com/server.chained.crt;
  ssl_certificate_key /usr/local/nginx/ssl/api.closic.com/server.key;

  location / {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-NginX-Proxy true;
    proxy_set_header Host $http_host;
    proxy_pass       http://127.0.0.1:3102;
    proxy_redirect   off;
  }
}

from prerender-node.

sandrocsimas avatar sandrocsimas commented on August 21, 2024

It seems that prerender is requesting the server using http.

prerender-5 2016-01-04T01:51:54.111Z getting http://www.closic.com/pt

Nginx redirects this url to https url.
How to tell prerender to request the https url?

from prerender-node.

thoop avatar thoop commented on August 21, 2024

Wherever you are sending the request to Prerender.io, you'll want to set the protocol to https. It sounds like you might be doing SSL termination in front of your server so that's why you're sending Prerender.io a request to an http URL.

from prerender-node.

sandrocsimas avatar sandrocsimas commented on August 21, 2024

OK @thoop, the problem was the proxy_pass to http://127.0.0.1:4000. I solved changing the node server running on 4000 to use https. Thanks!

from prerender-node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.