NGINX Starter (#211)

* nginx starter

* capitalize NGINX
This commit is contained in:
Jake Runzer
2021-10-13 01:39:38 +01:00
committed by GitHub
parent 7ae9666cf9
commit 9d1d75150d
3 changed files with 99 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
FROM nginx:alpine
COPY site /usr/share/nginx/html

35
examples/nginx/README.md Normal file
View File

@@ -0,0 +1,35 @@
---
title: NGINX
description: Deploy a static HTML file with NGINX
tags:
- nginx
- static
---
# NGINX Example
This example is deploys a site using [NGINX](https://www.nginx.com/)
[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/template?template=https%3A%2F%2Fgithub.com%2Frailwayapp%2Fexamples%2Ftree%2Fmaster%2Fexamples%2Fnginx&envs=PORT&optionalEnvs=PORT&PORTDefault=80)
## ✨ Features
- NGINX
- Static Site
## 💁‍♀️ How to use
- Open the `site/index.html` in the browser
## 📝 Notes
By default the `site/` directory gets deployed as a static site. This can be modified by changing the `Dockerfile`.
The site is deployed using the default NGINX configuration. This can be overridden with a custom conf file by adding
```
COPY nginx.conf /etc/nginx/nginx.conf
```
to the end of the Dockerfile. For more information, [read the docs](https://hub.docker.com/_/nginx).

View File

@@ -0,0 +1,62 @@
<html>
<head>
<title>NGINX on Railway</title>
<style>
body {
margin: 0;
padding: 2rem;
background-color: hsl(250, 24%, 9%);
color: hsl(0, 0%, 100%);
font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir,
segoe ui, helvetica neue, helvetica, Ubuntu, roboto, noto, arial,
sans-serif;
}
main {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100vh;
}
h1 {
font-size: 48px;
margin: 1rem 0;
}
.logo {
width: 8rem;
height: 8rem;
margin-bottom: 2rem;
}
a {
color: hsl(270, 70%, 65%);
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<main>
<img
src="https://railway.app/brand/logo-light.svg"
alt="Railway logo"
class="logo"
/>
<h1>NGINX on Railway</h1>
<p>
This is an example of an NGINX static site running on Railway.
<a href="https://github.com/railwayapp/starters">View source</a>.
</p>
</main>
</body>
</html>