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; large_client_header_buffers 4 16k;
location / { location / {
proxy_pass http://127.0.0.1:3002; # PORT belirtildi proxy_pass http://127.0.0.1:3002;
include /etc/nginx/proxy_params; include /etc/nginx/proxy_params;
} }
} }
# Geri kalan TÜM subdomain'ler buraya düşsün (api/cdn hariç)
server { server {
listen 443 ssl http2; 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 /etc/ssl/sozsoft.com/cert1.pem;
ssl_certificate_key /etc/ssl/sozsoft.com/privkey1.pem; ssl_certificate_key /etc/ssl/sozsoft.com/privkey1.pem;
@ -128,7 +127,7 @@ server {
large_client_header_buffers 4 16k; large_client_header_buffers 4 16k;
location / { location / {
proxy_pass https://sozsoft.com/login; proxy_pass http://127.0.0.1:3002;
include /etc/nginx/proxy_params; include /etc/nginx/proxy_params;
} }
} }

View file

@ -82,7 +82,7 @@ define(['./workbox-54d0af47'], (function (workbox) { 'use strict';
"revision": "3ca0b8505b4bec776b69afdba2768812" "revision": "3ca0b8505b4bec776b69afdba2768812"
}, { }, {
"url": "index.html", "url": "index.html",
"revision": "0.1jmha53s5bo" "revision": "0.fduoepfh2f"
}], {}); }], {});
workbox.cleanupOutdatedCaches(); workbox.cleanupOutdatedCaches();
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), { 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 dayjs from 'dayjs'
import { components } from 'react-select' import { components } from 'react-select'
import { ROUTES_ENUM } from '@/routes/route.constant' import { ROUTES_ENUM } from '@/routes/route.constant'
import { hasSubdomain } from '@/utils/subdomain'
interface SimpleProps extends CommonProps { interface SimpleProps extends CommonProps {
content?: ReactNode content?: ReactNode
@ -92,6 +93,7 @@ const Simple = ({ children, content, ...rest }: SimpleProps) => {
<Container className="flex flex-col flex-auto items-center justify-center min-w-0 h-full"> <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"> <Card className="min-w-[320px] md:min-w-[450px]" bodyClass="md:p-10">
<div className="flex justify-between items-center mb-4"> <div className="flex justify-between items-center mb-4">
{!hasSubdomain() && (
<a <a
href={ROUTES_ENUM.public.home} href={ROUTES_ENUM.public.home}
rel="noopener noreferrer" rel="noopener noreferrer"
@ -99,10 +101,11 @@ const Simple = ({ children, content, ...rest }: SimpleProps) => {
> >
<HiArrowLeft className="text-2xl" /> <HiArrowLeft className="text-2xl" />
</a> </a>
)}
<div className="w-12"> <div className="w-12">
<Select <Select
className='cursor-pointer' className="cursor-pointer"
options={languageOptions} options={languageOptions}
components={{ components={{
Option: CustomSelectOption, Option: CustomSelectOption,

View file

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

View file

@ -6,7 +6,7 @@ const NotFoundPage = () => {
const navigate = useNavigate() const navigate = useNavigate()
return ( return (
<div> <div className="p-20">
<div className="flex items-center justify-center font-inter"> <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"> <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 404