Knowledgebase

nginx.conf immutable flag is dangerous?

Posted by willsmith7, 04-04-2017, 09:08 PM
Hi, my Apache webserver is managed by nginx reverse proxy. My hoster put the immutable flag attribute to nginx.conf to make a redirect https-http that else didn't work. Do you think the immutable flag to nginx.conf may cause issues to the server? Visitors may be not able to see the site or something similar? Thanks in advance guys.

Posted by UNIXy, 04-04-2017, 09:17 PM
That's not quite what Nginx reverse proxying does but anyway. I'm guess your hoster is preventing changes from overwriting theirs. It's duct tape and could cause issues.

Posted by willsmith7, 04-04-2017, 09:28 PM
Thank you for answering What issues could it cause? They are visible or invisible? May i lose traffic due to these issues without realizing it? Last edited by willsmith7; 04-04-2017 at 09:35 PM.

Posted by vdzhorov, 04-05-2017, 07:33 AM
An immutable attribute in Linux simply disables anyone from making changes to that file. This does NOT affect the server in absolutely any way. Probably your hosting did this so the file cannot be changed without their permission and/or knowledge. You can refer to https://en.wikipedia.org/wiki/Chattr for example for more detailed information.

Posted by WPCYCLE, 04-05-2017, 08:18 AM
A few things are not making sense. You mean Nginx is in front of Apache? Honestly I've never seen anyone write about this. Setting a rewrite rule in Nginx is the same as writing a rewrite rule in htaccess for Apache. There's no reason to change the immutable flag attributes for Nginx's configuration file. A basic http/https rewrite would look something like this; server { listen 80 default_server; listen [::]:80 default_server; server_name _; return 301 https://$host$request_uri; } Your question leads to the question of what access do you have in order to have seen this? Is your account Shared, a VPS, or a Dedicated Server? Has your host worked with Nginx before?

Posted by willsmith7, 04-05-2017, 08:26 AM
Thanks a lot guys. Well, the redirect is https-http, not http-https. It was not possible to do it with htaccess, didn't work probably due to nginx reverse proxy passing the request to Apache, and Apache not recognizing SSL (that's what my hoster said). So, the hoster had to forbid the system to edit nginx.conf, then i made the redirect in the htaccess of the VPS and worked.

Posted by WPCYCLE, 04-05-2017, 09:31 AM
Your host says funny things

Posted by hid-den, 04-05-2017, 10:31 AM
So, you have VPS and don't have full root access to it to configure your entire system?

Posted by steven99, 04-05-2017, 01:39 PM
Sounds like nginx isn't sending https requests to apache as https requests but just http. This will cause problems on some scripts that check if https is used for access and see it isn't -- as it wont see nginx side of the connection but only nginx -> apache side and thus http. For example, a redirect loop could happen in this way as it tries to correct the lack of https. Wordpress with force admin ssl could be one example of a script causing that behavior as well as a shopping cart forcing ssl on checkouts. Could be a managed VPS where they don't allow root access in order to prevent customers from causing problems the provider then has to correct (for free or additional fee that customers don't like).

Posted by willsmith7, 04-05-2017, 05:07 PM
But i have a simple information blog with normal articles on Wordpress. Are there scripts that could cause a redirect loop in a blog like this?

Posted by steven99, 04-06-2017, 12:10 PM
Yes, if for example you have the url set in wordpress to https or some other item to force https set. I recently saw this with wordpress, though it only affected the login page and happened due to a custom config for just that site. If you aren't seeing this behavior though, you will be fine.



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read
VPS Postfix error (Views: 532)
CAn i use my own dns? (Views: 628)
IIS 401 Error??? (Views: 545)


Language:

Client Login

Email

Password

Remember Me

Search