302 Moved Error
-
That's an Apache config, not an Nginx config.
-
I have update my question.
-
I'm going to guess that this is not a common issue, as this thread already comes up nearly at the top of search results about this.
-
So if you bypass the Nginx reverse proxy, does the site work normally on the LAN?
-
What is the reason for your massively complicated reverse proxy configuration? That's nothing like what I use for Nextcloud.
-
I'm especially curious as to the intention of this section:
location \@backend { internal; proxy_pass http://192.168.1.2:8181; include proxy.inc; } location \@custom { internal; proxy_pass http://192.168.1.2:8181; include proxy.inc; } location ~ .*\.(php|jsp|cgi|pl|py)?\$ { proxy_pass http://192.168.1.2:8181; include proxy.inc; } location ~ /\.ht { deny all; }
-
@scottalanmiller said in 302 Moved Error:
So if you bypass the Nginx reverse proxy, does the site work normally on the LAN?
Yes, If I directly access the server [ 192.168.1.7 ], There is nothing problem.
@scottalanmiller said in 302 Moved Error:
I'm especially curious as to the intention of this section:
location \@backend { internal; proxy_pass http://192.168.1.2:8181; include proxy.inc; } location \@custom { internal; proxy_pass http://192.168.1.2:8181; include proxy.inc; } location ~ .*\.(php|jsp|cgi|pl|py)?\$ { proxy_pass http://192.168.1.2:8181; include proxy.inc; } location ~ /\.ht { deny all; }
I did not create this part, this is an automatically generated.
-
@emsanator said in 302 Moved Error:
I did not create this part, this is an automatically generated.
What auto-generated that? I'm a little confused as to your setup.
Generally you run NextCloud on Apache, that's the application server. Then if you want a reverse proxy, which most of us do, Nginx is perfect for this. But nothing on the Nginx would be auto-generated as it would not talk to the NextCloud box directly.
I think you might have layers of proxies here or something.
-
@scottalanmiller said in 302 Moved Error:
I think you might have layers of proxies here or something.
He has a disaster here.
Nothing is normal.
Also, if I followed the IP scheme right, he has the following:
Nextcloud running under Nginx and not Apache on: 192.168.1.7 This a non standard deployment. Not that it can be bad, but it is non standard.
Nginx and Apache running on 192.168.1.2. Again this is not what I would consider a standard way to deploy something like this. People do this all the time, but when you are in a VM environment, I prefer to use single task VMs.
Now he has Apache for publishing his internet sites on 192.168.1.2. fine.
He build Nextcloud on 192.168.1.7 Fine.
On to the vhost file on 192.168.1.2. Well this file is showing that it is listening on 192.168.1.7:8181. Well that is not possible as that IP is not on that box. 192.168.1.2 is the only system with Apache, so this has to be where the vhost file is as Nginx does not have vhost files.
So you either posted something wrong or you have totally hosed this entire thing up.
But let's continue.
The posted Nginx config file (incorrectly called a virtual host file also) contians a single server block listing on 192.168.1.2:443 only. It also only has forwarding posted that forward to 192.168.1.2:8181
So nothing is ever getting proxied to the nextcloud system.
Also port 8181 is not in the default list of ports the SELinux allowed to be used by HTTP,
Additionally, both config files are showing that the document roots are in subfolders of
/home/username/
. By default these locations will not have the proper permissions (user/group) or security contexts (SELinux) to be executed.Finally, as insinuated by @scottalanmiller, there is no default auto generating tool for Nginx Server blocks.
In conclusion, as posted, this configuration will never do ANYTHING as Nginx is listening on 443 and sending to apache port 8181, yet there is no apache instance listening on port 8181.
-
@scottalanmiller said in 302 Moved Error:
@emsanator said in 302 Moved Error:
I did not create this part, this is an automatically generated.
What auto-generated that? I'm a little confused as to your setup.
Generally you run NextCloud on Apache, that's the application server. Then if you want a reverse proxy, which most of us do, Nginx is perfect for this. But nothing on the Nginx would be auto-generated as it would not talk to the NextCloud box directly.
That auto generated stuff is only sending stuff to the Apache host on the same box as Nginx.
-
@jaredbusch said in 302 Moved Error:
That auto generated stuff is only sending stuff to the Apache host on the same box as Nginx.
Thanks for your valuable comments.
I solved this problem.
I've erased all routing on Nginx/Apache :smiling_face_with_smiling_eyes: ,I created a virtual server for HAproxy, I installed HAproxy and currently all virtual servers routing process was completed.
Only I have one problem with HAproxy conf. file, I do not know how to do FTP Routing.
if you want to see the topic, please visit this topic.