@aaronstuder & @scottalanmiller
I installed on Fedora 27 and I get same errors.
I prepared a GIF to better explain it.
@aaronstuder & @scottalanmiller
I installed on Fedora 27 and I get same errors.
I prepared a GIF to better explain it.
I have 2 VM for a Nextcloud and publishing my internet sites. These two servers are connected with ProxyPass.
(vhost.conf for 192.168.1.2)
<VirtualHost 192.168.1.7:8181>
ServerName domain.com
ServerAlias www.domain.com
ServerAdmin [email protected]
DocumentRoot /home/username/public_html/
UseCanonicalName Off
ScriptAlias /cgi-bin/ /home/username/public_html/_SubDomains/domain/cgi-bin/
# Custom settings are loaded below this line (if any exist)
# Include "/usr/local/apache/conf/userdata/username/domain.com/*.conf
<IfModule mod_userdir.c>
UserDir disabled
UserDir enabled username
</IfModule>
<IfModule mod_suexec.c>
SuexecUserGroup username username
</IfModule>
<IfModule mod_suphp.c>
suPHP_UserGroup username username
suPHP_ConfigPath /home/username
</IfModule>
ProxyPass / http://192.168.1.7/
ProxyPassReverse / http://192.168.1.7/
</VirtualHost>
Nginx:
# Virtual host file starts here
server {
listen 192.168.1.2:443;
access_log /var/log/nginx/access.domain.com.log;
error_log /var/log/nginx/error.domain.com.log;
server_name domain.com www.domain.com;
root /home/domain/public_html;
ssl on;
ssl_certificate /etc/pki/tls/certs/domain.com.bundle;
ssl_certificate_key /etc/pki/tls/private/domain.com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:20m;
ssl_session_timeout 60m;
add_header Strict-Transport-Security "max-age=31536000";
add_header X-Content-Type-Options nosniff;
location / {
location ~.*\.(3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|html|htm|txt|js|css|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso|woff|ttf|svg|eot|sh)\$ {
expires 7d; #Comment this out if you are using the apache backend cache-control/expires headers.
try_files \$uri \@backend;
}
error_page 405 = \@backend;
error_page 500 = \@custom;
add_header X-Cache "HIT from Backend";
proxy_pass http://192.168.1.2:8181;
include proxy.inc;
}
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;
}
}
# Virtual host file ends here
I am getting this error while loading the file:
PUT XHR https://domain.com/@custom [HTTP/1.1 302 Moved Temporarily 0ms]
There's only trouble adding files. Display, delete actions are no problem.
What could be the reason for this?
Also, no problem if I use the local IP address.
Thank you.
@JaredBusch hi,
I'm definitely resetting the Http server after every processing, I even started it again. I didn't succeed
I checked opcache with a small Php script. Opcache works successfully But Nextcloud does not see it.
Hi, I installed the OPcache ext. but I'm still getting OPcache alert on the Nextcloud admin page. I have added the OPcache values to the PHP.ini file.
What could be the reason?
listen FTP
bind *:21,:10000-10250
mode tcp
server ftp01 192.168.1.4 check port 21
server ftp02 192.168.1.5 check port 21
I do not get HAproxy error with this method
FileZilla Log:
Status: Connecting to <Public IP>:21...
Status: Connection established, waiting for welcome message...
Status: Initializing TLS...
Status: Verifying certificate...
Status: TLS connection established.
Status: Server does not support non-ASCII characters.
Status: Logged in
Status: Retrieving directory listing...
Status: Server sent passive reply with unroutable address. Using server address instead.
Command: MLSD
Error: The data connection could not be established: ECONNREFUSED - Connection refused by server
I tried every way in few days but I can not connect with FTP.
@manxam said in FTP Connection in the HAproxy:
You're missing a name declaration beside the listen in the last example that you posted.
listen <my_service_here>
and optionally the hostname and bind port:
listen <my_service_here> localhost:8080
I have one "listen" and for statistics.
Could you give an example for FTP listen?
I added this lines in HAproxy conf. file:
listen
bind <public IP>:21
mode tcp
server web-second <local IP>:21 check
Result:
[root@rp ~]# sudo systemctl restart haproxy
Job for haproxy.service failed because the control process exited with error code. See "systemctl status haproxy.service" and "journalctl -xe" for details.
[root@rp ~]# systemctl status haproxy.service
ā haproxy.service - SYSV: HA-Proxy is a TCP/HTTP reverse proxy which is particularly suited for high availability environments.
Loaded: loaded (/etc/rc.d/init.d/haproxy; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2018-04-05 19:48:57 UTC; 1s ago
Docs: man:systemd-sysv-generator(8)
Process: 15215 ExecStop=/etc/rc.d/init.d/haproxy stop (code=exited, status=0/SUCCESS)
Process: 15223 ExecStart=/etc/rc.d/init.d/haproxy start (code=exited, status=1/FAILURE)
Main PID: 15197 (code=killed, signal=TERM)
Apr 05 19:48:57 rp.domain.com systemd[1]: Starting SYSV: HA-Proxy is a TCP/HTTP reverse proxy which is particularly suited for high availability environments....
Apr 05 19:48:57 rp.domain.com haproxy[15223]: [ALERT] 094/194857 (15227) : parsing [/etc/haproxy/haproxy.cfg:81] : 'listen' expects an <id> argument and
Apr 05 19:48:57 rp.domain.com haproxy[15223]: optionally supports [addr1]:port1[-end1]{,[addr]:port[-end]}...
Apr 05 19:48:57 rp.domain.com haproxy[15223]: [ALERT] 094/194857 (15227) : Error(s) found in configuration file : /etc/haproxy/haproxy.cfg
Apr 05 19:48:57 rp.domain.com haproxy[15223]: Errors found in configuration file, check it with 'haproxy check'.
Apr 05 19:48:57 rp.domain.com systemd[1]: haproxy.service: control process exited, code=exited status=1
Apr 05 19:48:57 rp.domain.com systemd[1]: Failed to start SYSV: HA-Proxy is a TCP/HTTP reverse proxy which is particularly suited for high availability environments..
Apr 05 19:48:57 rp.domain.com systemd[1]: Unit haproxy.service entered failed state.
Apr 05 19:48:57 rp.domain.com systemd[1]: haproxy.service failed.
Where am I making mistakes?
@scottalanmiller No, will I set it in configuration file of vsftpd on the FTP machine?
@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.
Hi,
This is my HAproxy conf. file and everything works right without FTP connection.
I can not access the servers via FTP.
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
#log loghost local0 info
maxconn 4096
chroot /var/lib/haproxy
user haproxy
group haproxy
daemon
#debug
#quiet
stats socket /var/lib/haproxy/stats
defaults
log global
mode http
option httplog
option dontlognull
retries 3
redispatch
maxconn 2000
contimeout 5000
clitimeout 50000
srvtimeout 50000
listen stats
bind *:8080
mode http
option forwardfor
option httpclose
stats enable
stats show-legends
stats refresh 5s
stats uri /stats
stats realm Haproxy\ Statistics
stats auth hello:world
stats admin if TRUE
frontend MAIN
bind *:21
bind *:80
bind *:143
bind *:443
bind *:993
mode http
acl server1_URL hdr_dom(host) -i domain1.com
acl server2_URL hdr_dom(host) -i domain2.com
acl server3_URL hdr_dom(host) -i domain3.com
acl server4_URL hdr_dom(host) -i domain4.com
acl server5_URL hdr_dom(host) -i domain5.com
use_backend server1 if server1_URL
use_backend server2 if server2_URL
use_backend server3 if server3_URL
use_backend server4 if server4_URL
use_backend server5 if server5_URL
backend server1
mode http
server web-first 192.168.1.2:80
backend server2
mode http
server web-first 192.168.1.3:80
backend server3
mode http
server web-first 192.168.1.4:80
backend server4
mode http
server web-second 192.168.1.6:80
backend server5
mode http
server web-third 192.168.1.7:80
I tried this: it did not work
listen FTP :21,:10000-10250
mode tcp
server ftp01 192.168.1.4 check port 21
What should I do for it?
Thank you.
@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.