How to stop redirecting to /app - cloudflare

My site is on cloud flare for almost an year. All of sudden for last one week site is down with redirect loop error. Cloudflare is automatically adding /app at the end of the URL and doing a infinite redirect. This is what I see
curl -v http://manuals-store.com
response has
Location: https://manuals-store.com/app
This is constantly redirecting itself. Can anyone please help me how to fix this error?
Thanks in advance

Set two aliases in OpenShift:
example.com, and
www.example.com.
I had the same redirecting issue to /app when I used CNAME (in the Cloudflare) to connect to my OpenShift application.
NOTE: If you get an error in the OpenShift UI for any reason, use the rhc command
rhc alias add <application name> <custom domain name>
I know it is a late answer, but I hope it helps someone. :)

"Cloudflare is automatically adding /app"
We actually wouldn't add anything to your existing urls. I did a curl against the domain and IP address (the one that is found on the CNAME) and the redirect is directly on your server.

I've had this happen to me with Open Shift. All I had to do was add an alias for my domain to the gear running the app and the redirects worked properly.

Related

apache2: subdirectory won't work if I enable app at /

I built a personal server at home which is hosted at, let's say, example.org and I installed GitLab as a subdirectory so I can access to it at example.org/gitlab. As GitLab is the only one application I have so far, everything works smoothly.
Now I want to have a blog at root, so I enabled Apache default site to do some tests. I can see apache2 default page at example.org (which is where I want my blog) but GitLab won't work anymore at example.org/gitlab. All I have is a "page not found". GitLab will only work if I disable the default page at /.
I tried using Alias, I also read something about redirections but I haven't managed to make example.org and example.org/gitlab work together so far.
Any advice about where to look, please?
If you generate two virtualhosts both must have different ServerName, otherwise first match receives all requests and second virtualhost will be ignored.

LetsEncrypt using cloudflare server ssl error

Recently I discover letsencrypt which is awesome project, and it basically allows you to get ssl certificate for free.
I manage to setup my server and domain with their certificate, everything work great and my site showed the https in green which was great.
Then I connected this domain to cloudflare, which is another great solution, for many web problems.
Once my name servers were changed to cloudflare name servers the https stopped working.
:(
I am not really sure what is the root of that issue, but I manage to fixed it with a little bit of luck, so decided to write here the problem and the solution who worked for me in case other will encounter this issue in the future.
On cloudflare
https://www.cloudflare.com/a/crypto/yourdomain
default settings for ssl is full, once I changed it to
strict https start working again like charm.
2 days after I had the same issue, I changed it back to full from strict and then it worked again so I am confused and not sure if my answer here is good.
you need to use certbot when you're already using cloudflare.
check this link
So before you run the certbot command try this first export LC_ALL="C"
Then if you're on apache change the command to this
./certbot-auto certonly --webroot --webroot-path /var/www/html/ --renew-by-default --email email#host.tld --text --agree-tos -d example.tld -d www.example.tld
/var/www/html/ = where your webroot path for the domain is located.
I hope this helps..
I've faced the same issue that CloudFlare said there is a 526 error.
I could solve it by adding
SSLCertificateChainFile "/etc/letsencrypt/live/DOMAIN/chain.pem"
to the apache hosts config, since Apache < 2.4.8 needs the chain (see http://letsencrypt.readthedocs.org/en/latest/using.html)

How do I find out where my root URL is being served from in Apache?

I've recently got a VPS server and it came installed with CentOS, WHM and cPanel. I'm trying to find where the physical folder location the root URL of the server IP is being served. When I go to the root IP in a browser, I get a redirect to "/cgi-sys/defaultwebpage.cgi" with "SORRY!" and some error resolve details.
The server has a web-site running under "/cPanel" and also WHM runs on ":2083".
I'm trying take control of the content served directly at the /, and replace that defaultwebpage.cgi with an index.html.
I've tried httpd -V to check where the httpd.conf, is and then spotted a <VirtualHost *> in that config file, which points to a DocumentRoot of /use/local/apache/htdocs . But if I place index.html in this folder and try to hit it via /index.html, I still get routed to that defaultwebpage.cgi. Can anyone help me understand why its rerouting and not picking up that index.html?
Thanks.
You may want to try /var/www/html, at least that's in Ubuntu
If it's not it, then try going to /etc/apache2/apache2.conf and find the DocumentRoot option.
Hope this helps!

Why is my subdomain occasionally not accessible?

I own the following domain name: joynr.co
I've configured a subdomain: promoter.joynr.co
But sometimes, it's just not working, like a DNS error. Just like if it was still propagating. But it's been a week now :/
Where should I start looking ?
my apache confd files ? .htaccess ? or some configurations at AWS ? It's hosted a AWS, and domain name registered at godaddy.
I've followed this threat to configurer AWS/Go Daddy
Also, I've configured the confd so when accessing promoter.joynr.co you browse a different folder/website than when going to joynr.co (in /var/www ).
.htaccess is empty
Many Thanks
Any help would be much appreciated :)
Thanks
You have to have promoter NS records within the joynr.co domain, in order for the eponymous subdomain to be able to be recursively resolved.
Apparently in Route 53 you just do it the old-fashioned way - take the NS records you see in the promoter.joynr.co domain and copy&paste them into the parent domain, cf. http://github.com/toddm92/aws/wiki/Route-53-Subdomains
(Moved from comments and condensed.)

Redirect keystone app to sub directory using htaccess

I am new in htaccess. I am using Keystone.js, using which I developed a blog which is listening on port 3000. Like this:
https://localhost:3000
Everything is fine now. But what I want is that my blog should run on this url :
https://localhost/blog
How can I achieve this scenario where I provide "https://localhost/blog" and its should work like "https://localhost:3000". In this case URL will remain the same: https://localhost/blog
Plus I also want that when a user visits this url: "https://localhost:3000", it should redirect to: "https://localhost/blog".
How can I achieve this scenario? All I want is to hide a port from URL.
I have tried alot of things to work around but its not working for me.
Something like this:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^blog(.*) http://localhost:3000/$1 [P,L]
Ok now this about code is working perfect for main page i.e: https://localhost/blog because I added a rule for it in htaccess. But the issue is that all links, images & included files are broken in my blog.
Now I used base tag for this issue. But it converts my links to this format:
http://localhost:3000/contact
http://localhost:3000/help
http://localhost:3000/post
I considered http://localhost:3000/ as a base tag in my page head.
As you can see 3000 port is again appearing in urls which I dont want to show. It should be:
http://localhost/blog/contact
http://localhost/blog/help
http://localhost/blog/post
This is the safest and easiest way to run Node on port 80:
Login to the server and issue the following commands:
$ sudo apt-get install libcap2-bin
$ sudo setcap cap_net_bind_service=+ep /usr/local/bin/node
Note: Change the path to Node above to whatever is displayed when you type which node
Now when you tell Node to run on port 80, it won't complain. And you won't have to deal with Apache or Nginx, run your app as root, or worry about port forwarding.
I would advise to use NGINX to solve this issue. You can check those links :
https://allaboutghost.com/how-to-proxy-port-80-to-2368-for-ghost-with-nginx/
Node.js + Nginx - What now?