-server {
- listen 80;
- server_name 216.218.216.163;
- root /var/www/moms-website;
- index index.html;
- location / {
- try_files $uri $uri/ /index.html;
- }
- location /store {
- proxy_pass http://localhost:9000;
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection 'upgrade';
- proxy_set_header Host $host;
- proxy_cache_bypass $http_upgrade;
- }
-}
-# Redirect all HTTP to HTTPS with no-WWW
-server {
- listen 80 default_server;
- listen [::]:80 default_server;
- server_name ~^(?:www\.)?(.*)$;
- return 301 https://$1$request_uri;
-}
-
# API
server {
server_name api-dev.nutra.tk api.dev.nutra.tk;
--- /dev/null
+# Mom's Earthy Bites Kitchen storefront
+server {
+ server_name earthyenergy.mooo.com;
+
+ root /var/www/moms-website;
+ index index.html;
+
+ # Allow certbot verification
+ location /.well-known/acme-challenge/ {
+ root /var/www/html;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.html;
+ }
+
+ location /store {
+ proxy_pass http://localhost:9000;
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection 'upgrade';
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_cache_bypass $http_upgrade;
+ }
+
+ # Proxy to Medusa Auth API (Required for Dashboard login)
+ location /auth {
+ proxy_pass http://localhost:9000;
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection 'upgrade';
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_cache_bypass $http_upgrade;
+ }
+
+ # Proxy to Medusa Admin API (Required for Dashboard login)
+ location /admin {
+ proxy_pass http://localhost:9000;
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection 'upgrade';
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_cache_bypass $http_upgrade;
+ }
+
+ listen 443 ssl; # managed by Certbot
+ ssl_certificate /etc/letsencrypt/live/earthyenergy.mooo.com/fullchain.pem; # managed by Certbot
+ ssl_certificate_key /etc/letsencrypt/live/earthyenergy.mooo.com/privkey.pem; # managed by Certbot
+ include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
+ ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
+
+}
+
+server {
+ if ($host = earthyenergy.mooo.com) {
+ return 301 https://$host$request_uri;
+ } # managed by Certbot
+
+
+ listen 80;
+ server_name earthyenergy.mooo.com;
+ return 404; # managed by Certbot
+
+
+}
\ No newline at end of file