SubDomain ayarları

This commit is contained in:
Sedat ÖZTÜRK 2025-08-11 17:52:19 +03:00
parent 91be964a39
commit 943221ff5a
5 changed files with 25 additions and 17 deletions

View file

@ -110,15 +110,14 @@ server {
large_client_header_buffers 4 16k;
location / {
proxy_pass http://127.0.0.1:3002; # PORT belirtildi
proxy_pass http://127.0.0.1:3002;
include /etc/nginx/proxy_params;
}
}
# Geri kalan TÜM subdomain'ler buraya düşsün (api/cdn hariç)
server {
listen 443 ssl http2;
server_name ~^(?!api\.|cdn\.).+\.sozsoft\.com$;
server_name ~^(?!(devops|chat|ai|api|cdn)\.).*\.sozsoft\.com$;
ssl_certificate /etc/ssl/sozsoft.com/cert1.pem;
ssl_certificate_key /etc/ssl/sozsoft.com/privkey1.pem;
@ -128,7 +127,7 @@ server {
large_client_header_buffers 4 16k;
location / {
proxy_pass https://sozsoft.com/login;
proxy_pass http://127.0.0.1:3002;
include /etc/nginx/proxy_params;
}
}

View file

@ -82,7 +82,7 @@ define(['./workbox-54d0af47'], (function (workbox) { 'use strict';
"revision": "3ca0b8505b4bec776b69afdba2768812"
}, {
"url": "index.html",
"revision": "0.1jmha53s5bo"
"revision": "0.fduoepfh2f"
}], {});
workbox.cleanupOutdatedCaches();
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {

View file

@ -12,6 +12,7 @@ import appConfig from '@/configs/app.config'
import dayjs from 'dayjs'
import { components } from 'react-select'
import { ROUTES_ENUM } from '@/routes/route.constant'
import { hasSubdomain } from '@/utils/subdomain'
interface SimpleProps extends CommonProps {
content?: ReactNode
@ -92,17 +93,19 @@ const Simple = ({ children, content, ...rest }: SimpleProps) => {
<Container className="flex flex-col flex-auto items-center justify-center min-w-0 h-full">
<Card className="min-w-[320px] md:min-w-[450px]" bodyClass="md:p-10">
<div className="flex justify-between items-center mb-4">
<a
href={ROUTES_ENUM.public.home}
rel="noopener noreferrer"
className="text-gray-500 hover:text-gray-700"
>
<HiArrowLeft className="text-2xl" />
</a>
{!hasSubdomain() && (
<a
href={ROUTES_ENUM.public.home}
rel="noopener noreferrer"
className="text-gray-500 hover:text-gray-700"
>
<HiArrowLeft className="text-2xl" />
</a>
)}
<div className="w-12">
<Select
className='cursor-pointer'
className="cursor-pointer"
options={languageOptions}
components={{
Option: CustomSelectOption,

View file

@ -44,7 +44,9 @@ export const DynamicRouter: React.FC = () => {
</Route>
{dynamicRoutes
.filter((r) => r.routeType !== 'protected')
.filter((r) =>
hasSubdomain() ? r.routeType === 'authenticated' : r.routeType !== 'protected',
)
.map((route) => {
const Component = route.getComponent()
return (
@ -70,8 +72,12 @@ export const DynamicRouter: React.FC = () => {
}
/>
{/* Not Found */}
<Route path="*" element={<NotFound />} />
<Route
path="*"
element={
hasSubdomain() ? <Navigate to={ROUTES_ENUM.authenticated.login} replace /> : <NotFound />
}
/>
</Routes>
)
}

View file

@ -6,7 +6,7 @@ const NotFoundPage = () => {
const navigate = useNavigate()
return (
<div>
<div className="p-20">
<div className="flex items-center justify-center font-inter">
<div className="text-[8rem] sm:text-[10rem] md:text-[12rem] font-bold bg-gradient-to-br from-primary to-secondary bg-clip-text animate-pulse">
404