Skip to content

Commit

Permalink
#55 - removed repeated blocks of HTML code (#56)
Browse files Browse the repository at this point in the history
* #55 - fix: removed repeated blocks of code

* #55 - fix: fixed names of html files and routing in nginx

* #55 - fix: nginx fix
  • Loading branch information
kamilpiech97 authored Aug 23, 2024
1 parent d49ae2e commit 425cc44
Show file tree
Hide file tree
Showing 7 changed files with 535 additions and 592 deletions.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ services:
- lmt-dev
- traefik-proxy-blumilk-local
restart: unless-stopped

mailpit:
image: axllent/mailpit:v1.14.4
container_name: lmt-dev-mailpit-container
Expand Down
15 changes: 13 additions & 2 deletions environment/dev/app/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,26 @@ http {
sendfile on;
keepalive_timeout 65;

server {
server {
listen 80 default;
server_name lmt-nginx;

access_log /dev/stdout;
error_log /dev/stderr;

root /application/public;
index meetup.html;
index index.html;

location = /meetup.html {
if ($arg_meetupId) {
return 301 /meetup?$query_string;
}
return 404; # Return 404 if no meetupId is present
}

location = /meetup {
try_files /meetup.html =404;
}

location / {
try_files $uri $uri/ =404;
Expand Down
10 changes: 0 additions & 10 deletions environment/dev/nginx/nginx.conf

This file was deleted.

49 changes: 30 additions & 19 deletions environment/prod/app/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,35 @@ http {
sendfile on;
keepalive_timeout 65;

server {
listen 80 default;
server_name lmt-nginx;

access_log /dev/stdout;
error_log /dev/stderr;

root /application/public;
index meetup.html;

location / {
try_files $uri $uri/ =404;
}

location ~ \.php$ {
fastcgi_pass unix:/run/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
server {
listen 80 default;
server_name lmt-nginx;

access_log /dev/stdout;
error_log /dev/stderr;

root /application/public;
index index.html;

location = /meetup.html {
if ($arg_meetupId) {
return 301 /meetup?$query_string;
}
return 404; # Return 404 if no meetupId is present
}

location = /meetup {
try_files /meetup.html =404;
}

location / {
try_files $uri $uri/ =404;
}

location ~ \.php$ {
fastcgi_pass unix:/run/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}
}
Loading

0 comments on commit 425cc44

Please sign in to comment.