Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
223 views
in Technique[技术] by (71.8m points)

css - 找不到Blazor CSS(Blazor CSS not found)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

我遇到了类似的问题,并可以通过以下答案解决: Blazor Server-静态文件在非DEV环境中不链接


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...