How configure virtual hosts on Nginx (on Windows) - windows

I read some tutorials and also some topics how to config virtual hosts in nginx on windows.
I installed and i run successfully nginx with localhost example page.
After, under c:/nginx/html i created a subdirectory /hello/, with index.html in which the content is:
C:/nginx/html/hello/index.html
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>Hello!</h1>
</body>
</html>
After, in the nginx.conf file, under http, i added the following:
server {
listen 80;
server_name www.localhello.com;
root C:/nginx/html/hello;
index index.html;
}
I added www.localhello.com also in my hosts file.
When I try to quit and restart nginx, and when i type www.localhello.com in my browser appears always the content of localhost (the content of C:/nginx/html/index.html preinstalled file) and i'm not able to understand why happen this.

I removed the peripheral "C:"
Now with this configuration works:
server {
listen *:80;
server_name www.localhello.com;
root /nginx/html/hello;
index index.html;
}

Related

Go vanity imports, unrecognized import path, no-import meta tags

go is complaining that meta-tags don't exist, when they do.
➜ go version
go version go1.14.15 linux/amd64
➜ curl "https://go.mis.vision/mis-utils?go-get=1"
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>go.mis.vision/mis-utils</title>
<meta name="go-import" content="go.mis.vision/mis-utils ssh://git#ssh.dev.azure.com:v3/somewhere">
<meta name="go-source" content="go.mis.vision/mis-utils _ _ _">
<style>
* { font-family: sans-serif; }
body { margin-top: 0; }
.content { display: inline-block; }
code { display: block; font-family: monospace; font-size: 1em; background-color: #d5d5d5; padding: 1em; margin-bottom: 16px; }
ul { margin-top: 16px; margin-bottom: 16px; }
</style>
</head>
<body>
<div class="content">
<h2>go.mis.vision/mis-utils</h2>
<code>go get go.mis.vision/mis-utils</code>
<code>import "go.mis.vision/mis-utils"</code>
Home: https://godoc.org/go.mis.vision/mis-utils<br/>
Source: ssh://git#ssh.dev.azure.com:v3/somewhere<br/>
</div>
</body>
</html>
➜ go get go.mis.vision/mis-utils
go: go.mis.vision/mis-utils#v1.0.1: unrecognized import path "go.mis.vision/mis-utils": parse https://go.mis.vision/mis-utils?go-get=1: no go-import meta tags ()
What am I missing?
specify additional parameter for the repo in vanity config: "VCS": "git"
Turns out, vangen was producing an invalid go-import format.
It should be: go.mis.vision/mis-utils git ssh://git#ssh.dev.azure.com/v3/somewhere

Apache 2.4 maintenance html page image not loading

I am trying to implement maintenance page in apache 2.4 without restart and for specific 503 error code. I am following this site https://www.shellhacks.com/redirect-site-maintenance-page-apache-htaccess/
Below is my html file, image file maintenance.svg is also in same root htdocs folder:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body, html {
height: 100%;
margin: 0;
/* The image used */
background-image: url("maintenance.svg");
/* Full height */
height: 100%;
/* Center and scale the image nicely */
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
</style>
</head>
<body>
</body>
</html>
ReWrite rule as below :
DocumentRoot "${SRVROOT}/htdocs"
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
RewriteCond %{DOCUMENT_ROOT}/maintenance.enable -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /maintenance.html [L]
ErrorDocument 503 /maintenance.html
I am not expert in Apache, Need your help to load image using rewrite rule.
The final RewriteCond is what's doing exceptions to the rewrite. You can add another and it is implicitly AND'ed with the previous ones:
RewriteCond %{REQUEST_URI} !maintenance.svg

Using polymer in aptana studio 3 on mac

I am trying to get polymer installed and running my mac. I have downloaded all the files needed but when I use insert a test file I get an error saying that the "polymer field is not recognized". Can someone help please.Thanks.
<!DOCTYPE html>
<html>
<head>
<!-- Load platform.js for polyfill support. -->
<script src="bower_components/bower_components/platform/platform.js"></script>
<!-- import a custom element. -->
<link rel="import" href="bower_components/bower_components/polymer-ui-field/polymer-ui-field.html">
<link rel="import" href="bower_components/bower_components/polymer-ui-icon/polymer-ui-icon.html">
<!-- add a wee bit of styling. -->
<style>
html {
font-family: 'Helvetica Neue', 'Roboto', 'Arial', sans-serif;
font-size: 14px;
}
polymer-ui-field {
border: 1px solid #000;
margin: 10px;
height: 40px;
}
</style>
</head>
<body>
<polymer-ui-field>
<polymer-ui-icon icon="favorite"></polymer-ui-icon>
<input placeholder="This is a simple Polymer test using the polymer-ui-field and the polymer-ui-icon." flex>
</polymer-ui-field>
</body>
</html>
Your imports and script tag have bower_components doubled up. If this does not accurately reflect your file structure, you should remove the extra bower_components. If this does reflect your file structure, you should un-nest the second bower_components folder, as this may be interfering with relative file path references in the imported components.

CSS3 PIE not showing rounded corners in IE8 mode within IE11

I'm not getting rounded corners in IE8 mode within IE11.
I've tried both relative and absolute paths, and neither work.
The PIE.htc file is in the same folder as the html file. I'm running on Jetty and don't have a .htaccess file. The PIE.htc file can be loaded without any problem using http://localhost:8383/various_forms2_less/PIE.htc
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<style>
span.command_link_buttoned {
background-color: #96AFCF;
display: block;
width: 130px;
height:30px;
position:relative;
border-radius: 5px;
behavior: url(PIE.htc);
/*behavior: url(http://localhost:8383/various_forms2_less/PIE.htc);*/
}
</style>
</head>
<body>
<span class="command_link_buttoned">
Button
</span>
</body>
</html>

Heroku maintenance URL does not redirect

For test purposes, i have added the url http://google.com as the maintenance URL in heroku. When I turn the maintenance mode on and try to access my page, I get an ugly response instead of being redirected to google. Anyone else has that problem or do I not get something?
btw: the redirection to the error URL works just fine.
This is what I get as a response:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<style type="text/css">
html, body, iframe { margin: 0; padding: 0; height: 100%; }
iframe { display: block; width: 100%; border: none; }
</style>
<title>Offline for Maintenance</title></head>
</head>
<body>
<iframe src="http://google.com">
<p>Application Error</p>
</iframe>
</body>
</html>
This is the expected behavior, according to the Heroku support. They do not perform a redirect, but just include the page as an iframe into their own HTML file.
Too bad, that does not work so well if you host an API on Heroku that returns the responses in JSON or so.

Resources