When I execute my Blazor app on localhost everything is fine.
(当我在本地主机上执行Blazor应用程序时,一切都很好。)
When I upload the compiled code to my final server, the app works but all CSS/JS are missing. (当我将编译后的代码上传到最终服务器时,该应用程序可以运行,但是所有CSS / JS都丢失了。)
I use Centos 7 + Apache in reverse proxy mode. (我在反向代理模式下使用Centos 7 + Apache。)
My CNF: (我的CNF:)
<VirtualHost *:*>
RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}
</VirtualHost>
<VirtualHost *:80>
# Your domain name
ServerName 192.168.5.69
ProxyPreserveHost On
# The IP and port of the JBoss Enterprise Application Platform
# These represent the default values, if your HTTPD is on the same host
# as your JBoss Enterprise Application Platform managed domain or server
ProxyPass / http://localhost:5000/
ProxyPassReverse / http://localhost:5000/
# The location of the HTML files, and access control information
DocumentRoot /var/www/html
RewriteEngine on
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
RewriteRule /(.*) ws://127.0.0.1:5000/$1 [P]
<Directory /var/www/html>
Options -Indexes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
On Chrome console I see:
(在Chrome控制台上,我看到:)
Siti:12 GET http://192.168.5.69/js/JavaScriptInterop.js net::ERR_ABORTED 404 (Not Found)
Siti:11 GET http://192.168.5.69/css/site.css net::ERR_ABORTED 404 (Not Found)
Siti:10 GET http://192.168.5.69/css/font-awesome/font-awesome.min.css net::ERR_ABORTED 404 (Not Found)```
ask by marco3189 translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…