Я запускаю Ubuntu, Apache, mod_proxy_wstunnel (Включил), Солнечный Сервер и R. У меня есть солнечный сервер установки для слушания локально, и Apache для Проксирования запросов на солнечный сервер. Я имею, также устанавливают основную авторизацию в моей конфигурации Apache для всего домена.
Все прекрасно за исключением того, когда солнечное серверное приложение пытается выполнить веб-Запрос Сокета. Я получаю следующую ошибку.
WebSocket connection to 'ws://xxxxxx.com/shiny-application/__sockjs__/407/ercpnzw1/websocket' failed: Error during WebSocket handshake: Unexpected response code: 401
Я обычно просто добавлял бы, что точный URL для веб-Сокета всего лишь, этот sock.js URL в динамическом, и всегда изменяет.
Существует ли способ решить этот вопрос с regex в апачской конфигурации?
Для того, чтобы исправить эту проблему, скорее всего, вызванную реверсивным прокси с блестящим сервером и Apache. Добавить значение переменной disable_websockets true; как показано ниже. **NOTE: ** Похоже, это работает только с новыми версиями Shiny-Server (Shiny Server Professional v1.2.0 i believe).
# Define the user we should use when spawning R Shiny processes
run_as shiny;
disable_websockets true;
# Define a top-level server which will listen on a port
server {
# Instruct this server to listen on port 3838
listen 3838;
# Define the location available at the base URL
location / {
#### PRO ONLY ####
# Only up tp 20 connections per Shiny process and at most 3 Shiny processes
# per application. Proactively spawn a new process when our processes reach
# 90% capacity.
utilization_scheduler 20 .9 3;
#### END PRO ONLY ####
# Run this location in 'site_dir' mode, which hosts the entire directory
# tree at '/srv/shiny-server'
site_dir /srv/shiny-server;
# Define where we should put the log files for this location
log_dir /var/log/shiny-server;
# Should we list the contents of a (non-Shiny-App) directory when the user
# visits the corresponding URL?
directory_index on;
}
}