Last Updated
Viewed 14 Times
           

When I execute my Blazor app on localhost everything is fine. When I upload the compiled code to my final server, the app works but all CSS/JS are missing. I use Centos 7 + Apache in reverse proxy mode. My 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:

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)```

I'm trying to build a JSF app on a glassfish 4.1 server. I have a apache 2.4 in front of glassfish as a proxy server. The app is using the bootsfaces or the primefaces frameworks. The same happens to both of them.
What's my problem. When I run the app within my network, directly from the glassfish, everything are ok. It is also looking good when I run the app from web bypassing the apache proxy. But when I run it be calling it via apache, the css are not working. I have a look at the page source code and I found this: On the head part of my page, I have the

<link type="text/css" rel="stylesheet" href="/gk-1.0-SNAPSHOT/faces/javax.faces.resource/theme.css?ln=primefaces-aristo" />

link.
When I click on the href from the "glassfish" page, I can view the css contents.
But when I click on the href from the "apache" page, I got an 404 error page:

<h1>HTTP Status 404 - Not Found</h1><hr/><p><b>type</b> Status report</p><p><b>message</b>Not Found</p><p><b>description</b>The requested resource is not available.</p>

Both the jars are included to my war file.
Any help will be valueable
Thank you

Similar Question 2 : Blazor Sub menus with <NavLink>

I'm using the Blazor template which using the NavLink component. This wraps up the bootstrap menu so it's basically bootstrap underneath.

I cannot find any documentation about NavLink. I've seen a couple articles that explain some of the features such as Matching.

What is not explained is how to create sub menus.

Does anyone know how to do this?

How can I make a simple "jump to" part of already loaded page in Blazor? Like this in HTML:

<a href="#contact">Contact us</a>
...
<section id="contact">

Ideally I also want to have it smooth scroll down to this section. Thought I would try to solve this with CSS, but maybe not possible?

Similar Question 4 (2 solutions) : Blazor: Implementing 404 not found page

Similar Question 5 (1 solutions) : Blazor dynamically set CSS file

Similar Question 6 (1 solutions) : Different css files in Blazor pages

Similar Question 7 (1 solutions) : Blazor client.dll not found 404 [closed]

cc