#VNC
server {
listen 443 ssl http2;
server_name vnc.domain.ru;
client_max_body_size 10G;
ssl_certificate /etc/letsencrypt/live/domain.ru-0001/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domain.ru-0001/privkey.pem;
location / {
proxy_pass http://127.0.0.1:5998/;
}
location /websockify {
proxy_pass http://127.0.0.1:5998/websockify;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
#Nextlcoud
server {
listen 443 ssl http2;
server_name nextcloud.domain.ru;
keepalive_timeout 70;
ssl_certificate /etc/letsencrypt/live/domain.ru-0001/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/domain.ru-0001/privkey.pem; # managed by Certbot
# set max upload size and increase upload timeout:
client_max_body_size 10G;
client_body_timeout 300s;
fastcgi_buffers 64 4K;
location / {
location / {
proxy_pass http://localhost:8083;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache off;
# rewrite ^/\.well-known/carddav https://$server_name/remote.php/dav/ redirect;
# rewrite ^/\.well-known/caldav https://$server_name/remote.php/dav/ redirect;
}
}
# Rule borrowed from `.htaccess` to handle Microsoft DAV clients
location = / {
if ( $http_user_agent ~ ^DavClnt ) {
return 302 /remote.php/webdav/$is_args$args;
}
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# for `/.well-known`.
location ^~ /.well-known {
# The rules in this block are an adaptation of the rules
# in `.htaccess` that concern `/.well-known`.
location = /.well-known/carddav { return 301 /remote.php/dav/; }
location = /.well-known/caldav { return 301 /remote.php/dav/; }
location /.well-known/acme-challenge { try_files $uri $uri/ =404; }
location /.well-known/pki-validation { try_files $uri $uri/ =404; }
# Let Nextcloud's API for `/.well-known` URIs handle all other
# requests by passing them to the front-end controller.
return 301 /index.php$request_uri;
}
}
location /
не нужны.location /
и location = /
немножко конфликтуют.location / {
if ( $http_user_agent ~ ^DavClnt ) {
return 302 /remote.php/webdav/$is_args$args;
}
proxy_pass http://localhost:8083;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache off;
}
<VirtualHost *:8083>
ServerName soundpartner.reccloud.ru
ServerAlias www.soundpartner.reccloud.ru
DocumentRoot /var/www/html/nextcloud
# auto redirect HTTP to HTTPS
# Redirect permanent / https://soundpartner.reccloud.ru
# log files
ErrorLog /var/log/apache2/soundpartner.reccloud.ru.log
CustomLog /var/log/apache2/soundpartner.reccloud.ru.log combined
<Directory /var/www/html/nextcloud>
Options FollowSymlinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
#
# This file will automatically load configuration files provided by other
# applications, such as Drupal or Wordpress. These applications will be made
# available underneath a path with that package name, such as /drupal8.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##
#
#Redirect All HTTP
server {
listen 80;
server_name _;
return 301 https://$host$request_uri;
}
#PROXY
#
#Nextlcoud
server {
listen 443 ssl http2;
server_name soundpartner.reccloud.ru;
keepalive_timeout 70;
ssl_certificate /etc/letsencrypt/live/soundpartner.reccloud.ru-0001/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/soundpartner.reccloud.ru-0001/privkey.pem; # managed by Certbot
# set max upload size and increase upload timeout:
client_max_body_size 10G;
client_body_timeout 300s;
fastcgi_buffers 64 4K;
location / {
proxy_pass http://localhost:8083;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache off;
# rewrite ^/\.well-known/carddav https://$server_name/remote.php/dav/ redirect;
# rewrite ^/\.well-known/caldav https://$server_name/remote.php/dav/ redirect;
}
# Rule borrowed from `.htaccess` to handle Microsoft DAV clients
# location = / {
# if ( $http_user_agent ~ ^DavClnt ) {
# return 302 /remote.php/webdav/$is_args$args;
# }
# }
# location = /robots.txt {
# allow all;
# log_not_found off;
# access_log off;
# }
# for `/.well-known`.
location ^~ /.well-known {
# The rules in this block are an adaptation of the rules
# in `.htaccess` that concern `/.well-known`.
location = /.well-known/carddav { return 301 /remote.php/dav/; }
location = /.well-known/caldav { return 301 /remote.php/dav/; }
location /.well-known/acme-challenge { try_files $uri $uri/ =404; }
location /.well-known/pki-validation { try_files $uri $uri/ =404; }
# Let Nextcloud's API for `/.well-known` URIs handle all other
# requests by passing them to the front-end controller.
return 301 /index.php$request_uri;
}
}
#Xibo
server {
listen 443 ssl http2;
server_name xibo.reccloud.ru;
keepalive_timeout 70;
client_max_body_size 10G;
ssl_certificate /etc/letsencrypt/live/soundpartner.reccloud.ru-0001/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/soundpartner.reccloud.ru-0001/privkey.pem; # managed by Certbot
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
#Xibo REDIRECT OLD
#server {
# listen 8080;
# server_name xibo.reccloud.ru;
#
# location / {
# return 301 https://xibo.reccloud.ru$request_uri;
# }
#}
#Zabbix
server {
listen 443 ssl http2;
server_name zabbix.reccloud.ru;
keepalive_timeout 70;
client_max_body_size 10G;
ssl_certificate /etc/letsencrypt/live/soundpartner.reccloud.ru-0001/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/soundpartner.reccloud.ru-0001/privkey.pem; # managed by Certbot
location / {
location / {
proxy_pass http://192.168.121.2:8081;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
}
#Zabbix REDIRECT OLD
server {
listen 8081;
server_name zabbix.reccloud.ru;
location / {
return 301 https://zabbix.reccloud.ru$request_uri;
}
}
#VNC
server {
listen 443 ssl http2;
index vnc.html
server_name vnc.reccloud.ru;
client_max_body_size 10G;
ssl_certificate /etc/letsencrypt/live/soundpartner.reccloud.ru-0001/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/soundpartner.reccloud.ru-0001/privkey.pem; # managed by Certbot
location / {
proxy_pass http://127.0.0.1:5998/;
}
location /websockify {
proxy_pass http://127.0.0.1:5998/websockify;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
# Disable cache
proxy_buffering off;
}
# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
# listen 80;
# listen [::]:80;
#
# server_name example.com;
#
# root /var/www/example.com;
# index index.html;
#
# location / {
# try_files $uri $uri/ =404;
# }
#}
#VNC
server {
...
location = / {
rewrite ^ /vnc.html permanent;
}
location / {
proxy_pass http://127.0.0.1:5998/;
}
...
}
# Rule borrowed from `.htaccess` to handle Microsoft DAV clients
# location = / {
# if ( $http_user_agent ~ ^DavClnt ) {
# return 302 /remote.php/webdav/$is_args$args;
# }
#
curl -IL https://vnc.reccloud.ru
HTTP/2 301
...
location: https://vnc.reccloud.ru/vnc.html
HTTP/2 200
...
DirectoryIndex vnc.html
и убрать из конфига Nginx:location = / {
rewrite ^ /vnc.html permanent;
}
эти директивы ведь в разных блоках server и не пересекаются. Вероятно на стороне Apache что-то не так.