I've deployed a static vue.js website to Azure: https://surgedemo.z16.web.core.windows.net/
The dev build renders fine in Chrome and Safari on OS X and so does the production build when I serve it from the dist directory.
However, the CSS doesn't seem to be rendered from the website. I've uploaded the files with the correct mime types.
Weirdly, when I use the Chrome Developer Tools to prettify the CSS from the static site, it then renders fine.
Any ideas?
Thanks!
Looks like mimetype is not set correctly:
$ curl https://surgedemo.z16.web.core.windows.net/css/app.dc7c3871.css -v 2>&1 | grep Content-Type
< Content-Type: text/plain
Review this on azure. From other user experiences there could be some possible points of failure, check this hint:
Alright, got it. Had to purge my Cdn Endpoint. It has cached my file
when it had it's MIME type set to "application/octeet-stream".
Basically need to set it to "text/css" and then purge the Endpoint so
it gets a fresh version from the storage Account.
source: https://social.msdn.microsoft.com/Forums/azure/en-US/a65eee29-e021-4d4d-9feb-490f5c89b7ea/troubles-with-azure-cdn-and-css-files?forum=azurecdn
Related
My team is building a web application using Jquery. We are coding it with Visual Studio Code and running locally using npm's http-server.
I am trying to publish the application on a local IIS server to demo to our management team. I created a new site on IIS (for this topic, I'll call it "MyWebApplication"). I copied our code to the MyWebApplication folder under wwwroot. Our application, however, is not displaying properly from the server--it only displays some of the text, but the menu we created in JavaScript is not showing up.
Looking at the Network tab in the Chrome debugger, I do have an error:
GET http://{iisserver}/scripts/menudata.js?_=1524242509037 404 (Not Found)
The initiator is jquery-3.2.1.min.js:4.
Notice it's looking for the script in the root, http://{iisserver}/scripts/..., not in http://{iisserver}/MyWebApplication/scripts/....
If I expand the scripts folder on the Sources tab of Chrome's debugger, menudata.js and one other script related to our menu are not listed. All other .js files in the folder are.
The menu does show up if I copy my scripts folder from MyWebApplication directly to the wwwroot folder, but I shouldn't have to do that.
Are there any ideas on what I can do to make this script accessible from my IIS?
This is IIS 7.5 on Windows Server 2008 R2.
Edit:
This is a 404 log entry from the IIS log:
2018-04-23 14:29:16 x.x.x.x GET /scripts/menudata.js _=1524493754277 80 - x.x.x.x Mozilla/5.0+(Windows+NT+6.1;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/65.0.3325.181+Safari/537.36 404 0 2 187
The website with index.html is located here
http://www.example.com/index.html
The is using angular/javascript and i'm trying to serve up fake data with .json files
locally I can do this just fine. Its just very simple javascript ... If i have any CORS issues the browser will tell me in developer tools and i just enable a CORS extension in chrome.
Problem:
Go here : http://www.example.com/index.html#/devices
Reason it seems that no data is showing is the obvious message in that it cannot locate this path
http://www.example.com/api/devices.json
What am I doing wrong?
This is where devices.json is located ... under wwwroot
/example.com/wwwroot/api
IIS is serving 404s (not found) for various reasons, to find out what the problem for your request is, without enabled detailed errors, look at the http log files, locate the request in question and find the http sub-status:
192.168.1.200 GET /devices.json - 80 ... 404 3
the number to the right of the 404 is the sub-status, in this case the 3 means: MIME type restriction. IIS by default is not configured to serve status files with a .json extension. You have add a new MIME Type mapping in IIS on the server or site level.
you may not be owner of http://www.example.com/
your IIS settings are wrong. Try to set ist reachable under http://localhost/ or http://127.0.0.1/
You may also modify your host file under system32 folder but it's not recommended.
I decided to try out Bolt CMS on my web server, which has happily run several Wordpress sites for a few months now through PHP-FPM.
The site's front end works apparently fine, but the administration section of the site has problems. Every call to static content -- JS, CSS and image files -- results in a 404 (not found) error. What's more, when I look at the NGINX error logs I see that the server tries to access the files from this location:
/usr/share/nginx/
I don't use that directory anywhere in my nginx or bolt configurations! I've done "grep -R '/usr/share' ." in my nginx and bolt configuration directories, with no results returned.
Has anyone had this problem before? where is the /usr/share/nginx/ reference coming from?
Under distributions like RHEL/CentOS (probably others), /usr/share/nginx/ is the location of the default Nginx files. You can grep -R /etc/nginx and that will point you to where.
The usual problem that I encounter (create for my own misery) is that I will create the Nginx virtual host file as something like /etc/nginx/conf.d/example.com instead of /etc/nginx/conf.d/example.com.conf (note the .conf)
I want to debug my html + javascript site in IDEA and Chrome browser.
When I press 'debug' in console i got:
Failed to load resource file:///C:/js/angular.min.js
As I undestand, I need to set root path of my web site in properties. But where this option?
Such urls (site root-relative, the ones starting with slash) can't be properly resolved when opening file locally (using file:// protocol) - the browser will search for these files in your system root (C:/). You need using remote javascript debug configuration (access your html using the web server url rather than local path) to make this work. See http://wiki.jetbrains.net/intellij/Debugging_JavaScript_with_IntelliJ_IDEA#Remote_debugging for more information on remote javascript debugging in Idea
Note that Idea 12 supports so-called built-in webserver (http://confluence.jetbrains.com/display/WI/built-in+web+server), so you can test your code without installing a web server.
Instead of accessing from local file system try to access your html + javascript application from a web server by putting those appication files in web server.
Install XAMPP or WAMP in your system and copy your application into the htdocs folder to run that application locally.Also edit the files using IDEA from there.So,you can parallely edit using IEDA and run using XAMPP.
http://www.apachefriends.org/f/viewtopic.php?t=14173.
I have facing strange problem. I have deployed images and js file in Apache Tomcat directrory but it is not showing on page and a warning is coming up:
Resource interpreted as Image but transferred with MIME type text/html: "http://localhost:8084/webApp/img/access.jpg".
Earlier it was working fine but now jquery is also not working and the following error is coming up:
Uncaught ReferenceError: jQuery is not defined
Earlier this error message was appearing in Firefox but Chrome was working fine. But now it is showing the error in Chrome as well.
I have also tried to use the absolute path but no success.
<script src="/webApp/jquery-1.7.2.min.js"></script>
<img src="http://localhost:8084/webApp/img/access.jpg"/>
If you are using tomcat, you should locate the resources at $CATALINA_HOME/webapps/ROOT folder. From there, you might have access to the files.
You can check the access permissions from terminal. If you use unix / linux, locate to the folder:
cd $CATALINA_HOME/webapps/ROOT
And execute the command:
ls -la
This means it can be accessed by everyone, so should be available to everyone accessing to the server by browser
drwxr-x**r-x#** 22 user staff 704 11 jun 01:25 .
You could also try changing the permisions, but your server would be unsure:
sudo chmod a+rx webApp/img/access.jpg
Or go to the webApp folder via cd and execute
sudo chmod -R a+rx .
Deppending on your preferences (the last one means giving permission to all resources on webApp folder, what means givving access to all your projects in server, quite unsure...).
Hope it helps somebody.