nginx_history.diff 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  1. commit b62710efac804ff8c8a342aacdd74e361ff5692b
  2. Author: unknown <C:\TheBat\Mail>
  3. Date: Sat Apr 18 12:34:33 2026 +0200
  4. feat: implement Google OAuth, localize fonts, and fix translations
  5. diff --git a/nginx.conf b/nginx.conf
  6. index 3c83210..ac9b785 100644
  7. --- a/nginx.conf
  8. +++ b/nginx.conf
  9. @@ -37,8 +37,15 @@ server {
  10. access_log off;
  11. }
  12. + # Font files (local hosting, long-term cache)
  13. + location /fonts/ {
  14. + expires 10y;
  15. + add_header Cache-Control "public, immutable";
  16. + access_log off;
  17. + }
  18. +
  19. # Other static files
  20. - location ~* \.(?:ico|gif|jpe?g|png|woff2?|eot|otf|ttf|svg|webp|avif)$ {
  21. + location ~* \.(?:ico|gif|jpe?g|png|svg|webp|avif)$ {
  22. expires 7d;
  23. add_header Cache-Control "public";
  24. access_log off;
  25. commit 4e7163df2f3af8f7a4a451a577cf112fe0393e06
  26. Author: unknown <C:\TheBat\Mail>
  27. Date: Fri Apr 17 21:56:03 2026 +0200
  28. perf: optimize page speed (caching, font loading, lazy loading) and fix admin ui bug
  29. diff --git a/nginx.conf b/nginx.conf
  30. index fc10195..3c83210 100644
  31. --- a/nginx.conf
  32. +++ b/nginx.conf
  33. @@ -6,10 +6,42 @@ server {
  34. # Gzip Compression
  35. gzip on;
  36. - gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
  37. + gzip_static on;
  38. + gzip_vary on;
  39. + gzip_proxied any;
  40. + gzip_comp_level 6;
  41. + gzip_buffers 16 8k;
  42. + gzip_http_version 1.1;
  43. + gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml font/woff2;
  44. +
  45. + # Security Headers
  46. + add_header X-Frame-Options "SAMEORIGIN";
  47. + add_header X-XSS-Protection "1; mode=block";
  48. + add_header X-Content-Type-Options "nosniff";
  49. + add_header Referrer-Policy "strict-origin-when-cross-origin";
  50. + # add_header Content-Security-Policy "default-src 'self' http: https: data: blob: 'unsafe-inline'" always;
  51. location / {
  52. try_files $uri $uri/ /index.html;
  53. +
  54. + # Caching for index.html (don't cache)
  55. + location = /index.html {
  56. + add_header Cache-Control "no-store, no-cache, must-revalidate";
  57. + }
  58. + }
  59. +
  60. + # Static assets in /assets/ (Vite)
  61. + location /assets/ {
  62. + expires 1y;
  63. + add_header Cache-Control "public, immutable";
  64. + access_log off;
  65. + }
  66. +
  67. + # Other static files
  68. + location ~* \.(?:ico|gif|jpe?g|png|woff2?|eot|otf|ttf|svg|webp|avif)$ {
  69. + expires 7d;
  70. + add_header Cache-Control "public";
  71. + access_log off;
  72. }
  73. # Proxy API requests to backend
  74. @@ -17,6 +49,8 @@ server {
  75. proxy_pass http://127.0.0.1:8000/;
  76. proxy_set_header Host $host;
  77. proxy_set_header X-Real-IP $remote_addr;
  78. + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  79. + proxy_set_header X-Forwarded-Proto $scheme;
  80. }
  81. # Standalone Deploy Webhook
  82. @@ -32,12 +66,13 @@ server {
  83. proxy_set_header Upgrade $http_upgrade;
  84. proxy_set_header Connection "Upgrade";
  85. proxy_set_header Host $host;
  86. + proxy_read_timeout 86400;
  87. }
  88. # Static uploads
  89. location /uploads/ {
  90. alias /var/www/radionica3d/backend/uploads/;
  91. - expires 7d;
  92. + expires 30d;
  93. add_header Cache-Control "public";
  94. }
  95. commit 229204fd2bf5efaccdd53b667ae8d34c89561236
  96. Author: unknown <C:\TheBat\Mail>
  97. Date: Fri Apr 17 21:18:15 2026 +0200
  98. fix(nginx/backend): use 127.0.0.1 instead of localhost to avoid IPv6 issues and harden security
  99. diff --git a/nginx.conf b/nginx.conf
  100. index 0134f85..fc10195 100644
  101. --- a/nginx.conf
  102. +++ b/nginx.conf
  103. @@ -14,7 +14,7 @@ server {
  104. # Proxy API requests to backend
  105. location /api/ {
  106. - proxy_pass http://localhost:8000/;
  107. + proxy_pass http://127.0.0.1:8000/;
  108. proxy_set_header Host $host;
  109. proxy_set_header X-Real-IP $remote_addr;
  110. }
  111. @@ -27,7 +27,7 @@ server {
  112. # WebSocket requests
  113. location /ws/ {
  114. - proxy_pass http://localhost:8000/;
  115. + proxy_pass http://127.0.0.1:8000/;
  116. proxy_http_version 1.1;
  117. proxy_set_header Upgrade $http_upgrade;
  118. proxy_set_header Connection "Upgrade";
  119. commit fa2c09d93612b0027fa36c16a44d782163e97fa5
  120. Author: unknown <C:\TheBat\Mail>
  121. Date: Fri Apr 17 20:41:31 2026 +0200
  122. fix(nginx): remove duplicate /ws/ prefix for websocket proxying
  123. diff --git a/nginx.conf b/nginx.conf
  124. index 0c90674..0134f85 100644
  125. --- a/nginx.conf
  126. +++ b/nginx.conf
  127. @@ -27,7 +27,7 @@ server {
  128. # WebSocket requests
  129. location /ws/ {
  130. - proxy_pass http://localhost:8000/ws/;
  131. + proxy_pass http://localhost:8000/;
  132. proxy_http_version 1.1;
  133. proxy_set_header Upgrade $http_upgrade;
  134. proxy_set_header Connection "Upgrade";
  135. commit 3cd2994dfa88f30f006454870e8787446af0866c
  136. Author: unknown <C:\TheBat\Mail>
  137. Date: Fri Apr 17 19:41:29 2026 +0200
  138. fix: use explicit shell and venv paths in scripts
  139. diff --git a/nginx.conf b/nginx.conf
  140. index 12d540e..0c90674 100644
  141. --- a/nginx.conf
  142. +++ b/nginx.conf
  143. @@ -1,7 +1,7 @@
  144. server {
  145. server_name radionica3d.me 148.230.71.134;
  146. - root /var/www/radionica3d/html;
  147. + root /var/www/radionica3d/dist;
  148. index index.html;
  149. # Gzip Compression
  150. commit 169118e860e5bbaee3d253e166666e67f43bba21
  151. Author: unknown <C:\TheBat\Mail>
  152. Date: Fri Apr 17 19:30:53 2026 +0200
  153. style: remove www prefix
  154. diff --git a/nginx.conf b/nginx.conf
  155. index b7bbf6a..12d540e 100644
  156. --- a/nginx.conf
  157. +++ b/nginx.conf
  158. @@ -1,5 +1,5 @@
  159. server {
  160. - server_name radionica3d.me www.radionica3d.me;
  161. + server_name radionica3d.me 148.230.71.134;
  162. root /var/www/radionica3d/html;
  163. index index.html;
  164. @@ -54,6 +54,6 @@ server {
  165. } # managed by Certbot
  166. listen 80;
  167. - server_name radionica3d.me www.radionica3d.me;
  168. + server_name radionica3d.me;
  169. return 301 https://radionica3d.me$request_uri;
  170. }
  171. commit 767c4a5846dc951db722f35db3f80c17e025404a
  172. Author: unknown <C:\TheBat\Mail>
  173. Date: Fri Apr 17 19:26:05 2026 +0200
  174. chore: finalize nginx with ssl and correct paths
  175. diff --git a/nginx.conf b/nginx.conf
  176. index fe4139d..b7bbf6a 100644
  177. --- a/nginx.conf
  178. +++ b/nginx.conf
  179. @@ -1,8 +1,7 @@
  180. server {
  181. - listen 80;
  182. - server_name radionica3d.me www.radionica3d.me 148.230.71.134;
  183. + server_name radionica3d.me www.radionica3d.me;
  184. - root /usr/share/nginx/html;
  185. + root /var/www/radionica3d/html;
  186. index index.html;
  187. # Gzip Compression
  188. @@ -35,10 +34,26 @@ server {
  189. proxy_set_header Host $host;
  190. }
  191. - # Static uploads (if served via Nginx instead of FastAPI)
  192. + # Static uploads
  193. location /uploads/ {
  194. - alias /app/uploads/;
  195. + alias /var/www/radionica3d/backend/uploads/;
  196. expires 7d;
  197. add_header Cache-Control "public";
  198. }
  199. +
  200. + listen 443 ssl; # managed by Certbot
  201. + ssl_certificate /etc/letsencrypt/live/radionica3d.me/fullchain.pem; # managed by Certbot
  202. + ssl_certificate_key /etc/letsencrypt/live/radionica3d.me/privkey.pem; # managed by Certbot
  203. + include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  204. + ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  205. +}
  206. +
  207. +server {
  208. + if ($host = radionica3d.me) {
  209. + return 301 https://$host$request_uri;
  210. + } # managed by Certbot
  211. +
  212. + listen 80;
  213. + server_name radionica3d.me www.radionica3d.me;
  214. + return 301 https://radionica3d.me$request_uri;
  215. }
  216. commit 408b5288c2819b47476a2588938f87e2fd5a9b8f
  217. Author: unknown <C:\TheBat\Mail>
  218. Date: Fri Apr 17 19:23:21 2026 +0200
  219. chore: migrate to radionica3d.me domain
  220. diff --git a/nginx.conf b/nginx.conf
  221. index 539da66..fe4139d 100644
  222. --- a/nginx.conf
  223. +++ b/nginx.conf
  224. @@ -1,6 +1,6 @@
  225. server {
  226. listen 80;
  227. - server_name radionica3d.com www.radionica3d.com 148.230.71.134;
  228. + server_name radionica3d.me www.radionica3d.me 148.230.71.134;
  229. root /usr/share/nginx/html;
  230. index index.html;
  231. commit 36b39d97c8f342c6797bc07aa725d1897ad35027
  232. Author: unknown <C:\TheBat\Mail>
  233. Date: Fri Apr 17 19:08:09 2026 +0200
  234. fix: replace backend with localhost in nginx ws block
  235. diff --git a/nginx.conf b/nginx.conf
  236. index e66f9d7..539da66 100644
  237. --- a/nginx.conf
  238. +++ b/nginx.conf
  239. @@ -28,7 +28,7 @@ server {
  240. # WebSocket requests
  241. location /ws/ {
  242. - proxy_pass http://backend:8000/ws/;
  243. + proxy_pass http://localhost:8000/ws/;
  244. proxy_http_version 1.1;
  245. proxy_set_header Upgrade $http_upgrade;
  246. proxy_set_header Connection "Upgrade";
  247. commit e61c07a115797fd7ecfc06163518797550af5443
  248. Author: unknown <C:\TheBat\Mail>
  249. Date: Fri Apr 17 19:05:49 2026 +0200
  250. fix: add IP to nginx server_name
  251. diff --git a/nginx.conf b/nginx.conf
  252. index 0ba596e..e66f9d7 100644
  253. --- a/nginx.conf
  254. +++ b/nginx.conf
  255. @@ -1,6 +1,6 @@
  256. server {
  257. listen 80;
  258. - server_name radionica3d.com;
  259. + server_name radionica3d.com www.radionica3d.com 148.230.71.134;
  260. root /usr/share/nginx/html;
  261. index index.html;
  262. commit 60afc342de08f4bdb87a5e406d79585a926c2cc8
  263. Author: unknown <C:\TheBat\Mail>
  264. Date: Fri Apr 17 19:02:49 2026 +0200
  265. chore: setup standalone deploy infrastructure
  266. diff --git a/nginx.conf b/nginx.conf
  267. index 86bc57e..0ba596e 100644
  268. --- a/nginx.conf
  269. +++ b/nginx.conf
  270. @@ -15,12 +15,15 @@ server {
  271. # Proxy API requests to backend
  272. location /api/ {
  273. - proxy_pass http://backend:8000/;
  274. - proxy_http_version 1.1;
  275. - proxy_set_header Upgrade $http_upgrade;
  276. - proxy_set_header Connection 'upgrade';
  277. + proxy_pass http://localhost:8000/;
  278. + proxy_set_header Host $host;
  279. + proxy_set_header X-Real-IP $remote_addr;
  280. + }
  281. +
  282. + # Standalone Deploy Webhook
  283. + location /deploy-webhook {
  284. + proxy_pass http://127.0.0.1:9000;
  285. proxy_set_header Host $host;
  286. - proxy_cache_bypass $http_upgrade;
  287. }
  288. # WebSocket requests
  289. commit 9e9e68d399ca3a1e2b59119325d3e8603dca9f50
  290. Author: unknown <C:\TheBat\Mail>
  291. Date: Fri Apr 17 18:48:02 2026 +0200
  292. Auto-init: project ready for production
  293. diff --git a/nginx.conf b/nginx.conf
  294. new file mode 100644
  295. index 0000000..86bc57e
  296. --- /dev/null
  297. +++ b/nginx.conf
  298. @@ -0,0 +1,41 @@
  299. +server {
  300. + listen 80;
  301. + server_name radionica3d.com;
  302. +
  303. + root /usr/share/nginx/html;
  304. + index index.html;
  305. +
  306. + # Gzip Compression
  307. + gzip on;
  308. + gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
  309. +
  310. + location / {
  311. + try_files $uri $uri/ /index.html;
  312. + }
  313. +
  314. + # Proxy API requests to backend
  315. + location /api/ {
  316. + proxy_pass http://backend:8000/;
  317. + proxy_http_version 1.1;
  318. + proxy_set_header Upgrade $http_upgrade;
  319. + proxy_set_header Connection 'upgrade';
  320. + proxy_set_header Host $host;
  321. + proxy_cache_bypass $http_upgrade;
  322. + }
  323. +
  324. + # WebSocket requests
  325. + location /ws/ {
  326. + proxy_pass http://backend:8000/ws/;
  327. + proxy_http_version 1.1;
  328. + proxy_set_header Upgrade $http_upgrade;
  329. + proxy_set_header Connection "Upgrade";
  330. + proxy_set_header Host $host;
  331. + }
  332. +
  333. + # Static uploads (if served via Nginx instead of FastAPI)
  334. + location /uploads/ {
  335. + alias /app/uploads/;
  336. + expires 7d;
  337. + add_header Cache-Control "public";
  338. + }
  339. +}