mirror of
https://github.com/SrIzan10/starters.git
synced 2026-05-01 11:05:16 +00:00
2
examples/nginx/Dockerfile
Normal file
2
examples/nginx/Dockerfile
Normal file
@@ -0,0 +1,2 @@
|
||||
FROM nginx:alpine
|
||||
COPY site /usr/share/nginx/html
|
||||
35
examples/nginx/README.md
Normal file
35
examples/nginx/README.md
Normal 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/)
|
||||
|
||||
[](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).
|
||||
62
examples/nginx/site/index.html
Normal file
62
examples/nginx/site/index.html
Normal 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>
|
||||
Reference in New Issue
Block a user