# Ribica

One shop to rule them all!


## Unsuported towns

 <option value="78255">Aleksandrovac</option>
                              <option value="89245">Avtovac</option>
                              <option value="76310">Balatun</option>
                              <option value="78000">Banja Luka</option>
                              <option value="75290">Banovici</option>
                              <option value="76312">Batkovic</option>
                              <option value="72233">Begov Han</option>
                              <option value="88363">Berkovici</option>
                              <option value="77000">Bihac</option>
                              <option value="76204">Bijela</option>
                              <option value="76300">Bijeljina</option>
                              <option value="73263">Bijelo Brdo</option>
                              <option value="89230">Bileca</option> 
                              <option value="72248">Biljesevo</option>
                              <option value="88407">Bjelimici</option>
                              <option value="88201">Blagaj</option>
                              <option value="74275">Blatnica</option>
                              <option value="88263">Blatnica Kod Mostara</option>
                              <option value="71215">Blazuj</option>
                              <option value="76277">Bok</option>
                              <option value="74322">Boljanic</option>
                              <option value="77240">Bosanska Krupa</option>
                              <option value="77250">Bosanski Petrovac</option>
                              <option value="80270">Bosansko Grahovo</option>
                              <option value="88408">Bradina</option>
                              <option value="75420">Bratunac</option>
                              <option value="76000">Brcko</option>
                              <option value="76100">Brcko Distrikt</option>
                              <option value="77205">Brekovica</option>
                              <option value="74210">Brestovo</option>
                              <option value="71255">Brestovsko</option>
                              <option value="71370">Breza</option>
                              <option value="79208">Brezicani</option>
                              <option value="76109">Brezik</option>
                              <option value="76216">Brezovo Polje</option>
                              <option value="74206">Brijesnica</option>
                              <option value="74206">Brijesnica Kod Doboja</option>
                              <option value="74206">Brijesnica Mala</option>
                              <option value="74206">Brijesnica Velika</option>
                              <option value="76206">Brka</option>
                              <option value="72243">Brnjic</option>
                              <option value="88243">Brocanac</option>
                              <option value="88243">Brocanac</option>
                              <option value="73309">Brod Kod Foce</option>
                              <option value="76313">Brodac</option>
                              <option value="78204">Bronzani Majdan</option>
                              <option value="72290">Bucici</option>
                              <option value="70230">Bugojno</option>
                              <option value="75203">Bukinje</option>
                              <option value="74277">Buletic</option>
                              <option value="88202">Buna</option>
                              <option value="72260">Busovaca</option>
                              <option value="88409">Buturovicpolje</option>
                              <option value="77245">Buzim</option>
                              <option value="73280">Cajnice</option>
                              <option value="75405">Caparde</option>
                              <option value="88300">Capljina</option>
                              <option value="72224">Cardak</option>
                              <option value="71347">Careva Cuprija</option>
                              <option value="72246">Catici</option>
                              <option value="77220">Cazin</option>
                              <option value="74274">Cecava</option>
                              <option value="88404">Celebici</option>
                              <option value="80203">Celebici Lusnic</option>
                              <option value="73307">Celebici Kod Foce</option>
                              <option value="75246">Celic</option>
                              <option value="78240">Celinac</option>
                              <option value="89243">Cemerno</option>
                              <option value="88265">Cerin</option>
                              <option value="74211">Cerovica</option>
                              <option value="78403">Cerovljani</option>
                              <option value="88260">Citluk</option>
                              <option value="77226">Coralici</option>
                              <option value="76239">Crkvina</option>
                              <option value="88367">Crnici</option>
                              <option value="76328">Crnjelovo</option>
                              <option value="71221">Dejcici</option>
                              <option value="79243">Demirovac</option>
                              <option value="74400">Derventa</option>
                              <option value="75444">Derventa Kod Vlasenice</option>
                              <option value="89233">Divin</option>
                              <option value="74000">Doboj</option>
                              <option value="74206">Doboj Istok</option>
                              <option value="74203">Doboj Jug</option>
                              <option value="75328">Doborovci</option>
                              <option value="75308">Dobosnica</option>
                              <option value="77210">Dobretici</option>
                              <option value="71245">Dobrinja</option>
                              <option value="79223">Dobrljin</option>
                              <option value="77242">Dobro Selo</option>
                              <option value="73247">Dobrun</option>
                              <option value="75206">Dokanj</option>
                              <option value="72278">Dolac Na Lasvi</option>
                              <option value="76233">Domaljevac</option>
                              <option value="88305">Domanovici</option>
                              <option value="76274">Donja Mahala</option>
                              <option value="76257">Donja Medjidja</option>
                              <option value="76327">Donja Slatina</option>
                              <option value="71305">Donje Mostre</option>
                              <option value="79228">Donji Agici</option>
                              <option value="88343">Donji Memici</option>
                              <option value="70220">Donji Vakuf</option>
                              <option value="78432">Donji Vijacani</option>
                              <option value="79289">Donji Vrbljani</option>
                              <option value="76273">Donji Zabar</option>
                              <option value="76323">Dragaljevac</option>
                              <option value="74209">Dragalovci</option>
                              <option value="78215">Dragocaj</option>
                              <option value="88215">Dreznica</option>
                              <option value="75410">Drinjaca</option>
                              <option value="88344">Drinovci</option>
                              <option value="80260">Drvar</option>
                              <option value="75358">Duboki Potok</option>
                              <option value="75308">Dubostica</option>
                              <option value="78411">Dubrave</option>
                              <option value="75274">Dubrave Donje</option>
                              <option value="75273">Dubrave Gornje</option>
                              <option value="79227">Dubrovik</option>
                              <option value="74483">Dugo Polje</option>
                              <option value="75272">Djurdjevik</option>
                              <option value="75445">Dusanovo</option>
                              <option value="88342">Duzice</option>
                              <option value="76311">Dvorovi</option>
                              <option value="79264">Fajtovci</option>
                              <option value="73300">Foca</option>
                              <option value="71270">Fojnica</option>
                              <option value="89247">Fojnica Kod Gacka</option>
                              <option value="88306">Gabela Polje</option>
                              <option value="89240">Gacko</option>
                              <option value="80230">Glamoc</option>
                              <option value="76318">Glavicice</option>
                              <option value="72230">Globarica</option>
                              <option value="71275">Gojevici</option>
                              <option value="73000">Gorazde</option>
                              <option value="88340">Gorica</option>
                              <option value="77222">Gornja Koprivna</option>
                              <option value="76238">Gornja Slatina</option>
                              <option value="75208">Gornja Tuzla</option>
                              <option value="79266">Gornji Kamengrad</option>
                              <option value="78405">Gornji Podgradci</option>
                              <option value="76207">Gornji Rahic</option>
                              <option value="78439">Gornji Strpci</option>
                              <option value="74272">Gornji Teslic</option>
                              <option value="70240">Gornji Vakuf Uskoplje</option>
                              <option value="76207">Gornji Zovik</option>
                              <option value="89201">Grab</option>
                              <option value="78227">Grabovica</option>
                              <option value="75320">Gracanica</option>
                              <option value="70233">Gracanica Kod Bugojna</option>
                              <option value="75276">Gracanica Selo</option>
                              <option value="88392">Gradac</option>
                              <option value="76250">Gradacac</option>
                              <option value="78400">Gradiska</option>
                              <option value="88340">Grude</option>
                              <option value="80205">Guber</option>
                              <option value="80204">Listani</option>
                              <option value="72277">Guca Gora</option>
                              <option value="71240">Hadzici</option>
                              <option value="72225">Hajdarevici</option>
                              <option value="72245">Haljinici</option>
                              <option value="72281">Han Bila</option>
                              <option value="71360">Han Pijesak</option>
                              <option value="71212">Hrasnica</option>
                              <option value="88395">Hrasno</option>
                              <option value="71144">Hresa</option>
                              <option value="78436">Hrvacani</option>
                              <option value="75216">Husino</option>
                              <option value="88394">Hutovo</option>
                              <option value="71210">Ilidza</option>
                              <option value="71380">Ilijas</option>
                              <option value="73208">Ilovaca</option>
                              <option value="78234">Imljani</option>
                              <option value="77208">Izacic</option>
                              <option value="88420">Jablanica</option>
                              <option value="71423">Jahorina</option>
                              <option value="70101">Jajce</option>
                              <option value="76316">Janja</option>
                              <option value="72215">Janjici</option>
                              <option value="88224">Jare</option>
                              <option value="78233">Javorani</option>
                              <option value="74264">Jelah</option>
                              <option value="77241">Jezerski</option>
                              <option value="79244">Johova</option>
                              <option value="73319">Josanica</option>
                              <option value="78244">Josavka</option>
                              <option value="72264">Kacuni</option>
                              <option value="72240">Kakanj</option>
                              <option value="74413">Kalenderovci</option>
                              <option value="75260">Kalesija</option>
                              <option value="71230">Kalinovik</option>
                              <option value="77204">Kamenica</option>
                              <option value="72265">Kaonik</option>
                              <option value="71213">Kasindo</option>
                              <option value="80246">Kazaginac</option>
                              <option value="88283">Kifino Selo</option>
                              <option value="71250">Kiseljak</option>
                              <option value="75211">Kiseljak, Kod Tuzle</option>
                              <option value="75280">Kladanj</option>
                              <option value="74452">Klakar Donji</option>
                              <option value="79280">Kljuc</option>
                              <option value="88324">Klobuk</option>
                              <option value="74207">Klokotnica</option>
                              <option value="78230">Knezevo</option>
                              <option value="78230">Skender Vakuf</option>
                              <option value="79246">Knezica</option>
                              <option value="71356">Knezina</option>
                              <option value="78423">Kobas</option>
                              <option value="88226">Kocerin</option>
                              <option value="78409">Kocicevo</option>
                              <option value="78207">Kola</option>
                              <option value="80244">Kongora</option>
                              <option value="88400">Konjic</option>
                              <option value="77249">Konjoder</option>
                              <option value="74489">Koprivna</option>
                              <option value="75247">Koraj</option>
                              <option value="76236">Kornica</option>
                              <option value="74253">Kosova</option>
                              <option value="76276">Kostric</option>
                              <option value="78220">Kotor Varos</option>
                              <option value="74215">Kotorsko</option>
                              <option value="72226">Kovaci</option>
                              <option value="79002">Kozarac</option>
                              <option value="79240">Bosanska Dubica</option>
                              <option value="75413">Kozluk</option>
                              <option value="72244">Kraljeva Sutjeska</option>
                              <option value="71260">Kresevo</option>
                              <option value="78256">Kriskovci</option>
                              <option value="78206">Krupa Na Vrbasu</option>
                              <option value="88203">Krusevo</option>
                              <option value="78424">Kukulje</option>
                              <option value="71216">Kula</option>
                              <option value="78443">Kulasi</option>
                              <option value="77206">Kulen Vakuf</option>
                              <option value="80320">Kupres</option>
                              <option value="78250">Laktasi</option>
                              <option value="78407">Laminci Sredjani</option>
                              <option value="79204">Lamovita</option>
                              <option value="89208">Lastva</option>
                              <option value="72216">Lasva</option>
                              <option value="78222">Liplje</option>
                              <option value="75213">Lipnica</option>
                              <option value="78434">Lisnja</option>
                              <option value="80101">Livno</option>
                              <option value="75214">Ljubace</option>
                              <option value="79206">Ljubija</option>
                              <option value="88380">Ljubinje</option>
                              <option value="89209">Ljubomir</option>
                              <option value="88320">Ljubuski</option>
                              <option value="88223">Ljuti Dolac</option>
                              <option value="76278">Loncari</option>
                              <option value="75240">Lopare</option>
                              <option value="75300">Lukavac</option>
                              <option value="75301">Lukavac Mjesto</option>
                              <option value="75327">Lukavica</option>
                              <option value="79267">Lusci Palanka</option>
                              <option value="74250">Maglaj</option>
                              <option value="74216">Majevac</option>
                              <option value="77235">Mala Kladusa</option>
                              <option value="74418">Mala Socanica</option>
                              <option value="75320">Malesici</option>
                              <option value="76208">Maoca</option>
                              <option value="78410">Masici</option>
                              <option value="78223">Maslovare</option>
                              <option value="76271">Matici</option>
                              <option value="74203">Matuzici</option>
                              <option value="88266">Medjugorje</option>
                              <option value="79247">Medjuvodje</option>
                              <option value="72282">Mehurici</option>
                              <option value="80243">Mesihovina</option>
                              <option value="75446">Milici</option>
                              <option value="73283">Miljeno</option>
                              <option value="73313">Miljevina</option>
                              <option value="74485">Milosevac</option>
                              <option value="75329">Miricina</option>
                              <option value="74480">Modrica</option>
                              <option value="71428">Mokro</option>
                              <option value="89204">Mosko</option>
                              <option value="88000">Mostar</option>
                              <option value="88000">Mostar, Jug</option>
                              <option value="88000">Mostar, Jugozapad</option>
                              <option value="88000">Mostar, Sjever</option>
                              <option value="88000">Mostar, Zapad</option>
                              <option value="75212">Mramor</option>
                              <option value="73206">Mravinjac</option>
                              <option value="79544">Mrkodol</option>
                              <option value="70260">Mrkonjic Grad</option>
                              <option value="72212">Nemila</option>
                              <option value="88390">Neum</option>
                              <option value="88280">Nevesinje</option>
                              <option value="72276">Nova Bila</option>
                              <option value="78418">Nova Topola</option>
                              <option value="79220">Bosanski Novi</option>
                              <option value="74254">Novi Seher</option>
                              <option value="72290">Novi Travnik</option>
                              <option value="78428">Nozicko</option>
                              <option value="70225">Oborci</option>
                              <option value="76235">Obudovac</option>
                              <option value="76290">Odzak</option>
                              <option value="74470">Vukosavlje</option>
                              <option value="88285">Odzak Kod Nevesinja</option>
                              <option value="71340">Olovo</option>
                              <option value="79203">Omarska</option>
                              <option value="78406">Orahova</option>
                              <option value="75323">Orahovica Donja</option>
                              <option value="76270">Orasje</option>
                              <option value="74412">Osinja</option>
                              <option value="74225">Osjecani</option>
                              <option value="75406">Osmaci</option>
                              <option value="79263">Ostra Luka</option>
                              <option value="88423">Ostrozac</option>
                              <option value="77228">Ostrozac Kod Cazina</option>
                              <option value="77244">Otoka</option>
                              <option value="72238">Ozimica</option>
                              <option value="78437">Palackovci</option>
                              <option value="71420">Pale</option>
                              <option value="75435">Papraca</option>
                              <option value="71243">Pazaric</option>
                              <option value="77227">Pecigrad</option>
                              <option value="76256">Pelagicevo</option>
                              <option value="72112">Perin Han</option>
                              <option value="74317">Petrovo</option>
                              <option value="75412">Pilica</option>
                              <option value="78217">Piskavica</option>
                              <option value="88305">Pocitelj</option>
                              <option value="72252">Poculica</option>
                              <option value="71425">Podgrab</option>
                              <option value="80209">Podhum</option>
                              <option value="71387">Podlugovi</option>
                              <option value="74217">Podnovlje</option>
                              <option value="75355">Podorasje Kod Srebrenika</option>
                              <option value="77232">Podzvizd</option>
                              <option value="75303">Poljice</option>
                              <option value="75320">Popovi</option>
                              <option value="88240">Posusje</option>
                              <option value="78216">Potkozarje</option>
                              <option value="78435">Potocani</option>
                              <option value="88208">Potoci</option>
                              <option value="73290">Praca</option>
                              <option value="73245">Prelovo</option>
                              <option value="79287">Previja</option>
                              <option value="74276">Pribinic</option>
                              <option value="75249">Priboj Kod Lopara</option>
                              <option value="79101">Prijedor</option>
                              <option value="80202">Priluka</option>
                              <option value="80245">Prisoje</option>
                              <option value="78430">Prnjavor</option>
                              <option value="80206">Prolog</option>
                              <option value="88440">Prozor</option>
                              <option value="70223">Prusac</option>
                              <option value="71335">Przici</option>
                              <option value="72207">Puhovac</option>
                              <option value="75305">Puracic</option>
                              <option value="88325">Radisici</option>
                              <option value="75268">Rainci Gornji</option>
                              <option value="88245">Rakitno</option>
                              <option value="71217">Rakovica</option>
                              <option value="80247">Rasko Polje</option>
                              <option value="78429">Razboj Lijevce</option>
                              <option value="76218">Razljevo</option>
                              <option value="79288">Ribnik</option>
                              <option value="77215">Ripac</option>
                              <option value="73220">Rogatica</option>
                              <option value="79226">Rudice</option>
                              <option value="73260">Rudo</option>
                              <option value="88347">Ruzici</option>
                              <option value="76230">Bosanski Samac</option>
                              <option value="79285">Sanica Gornja</option>
                              <option value="79260">Sanski Most</option>
                              <option value="75411">Sapna</option>
                              <option value="78202">Saracica</option>
                              <option value="71000">Sarajevo</option>
                              <option value="71103">Sarajevo, Centar</option>
                              <option value="71160">Sarajevo, Novi Grad</option>
                              <option value="71120">Sarajevo, Novo Sarajevo</option>
                              <option value="71140">Sarajevo, Stari Grad</option>
                              <option value="76209">Satorovici</option>
                              <option value="73305">Sekovici</option>
                              <option value="75450">Sekovici</option>
                              <option value="71321">Semizovac</option>
                              <option value="76205">Seonjaci</option>
                              <option value="75275">Serici</option>
                              <option value="75245">Sibosnica</option>
                              <option value="78433">Sibovska</option>
                              <option value="75207">Simin Han</option>
                              <option value="78364">Sipovo</option>
                              <option value="78224">Siprage</option>
                              <option value="88220">Siroki Brijeg</option>
                              <option value="78422">Sitnesi</option>
                              <option value="79283">Sitnica</option>
                              <option value="75436">Skelani</option>
                              <option value="74261">Skugric</option>
                              <option value="75353">Sladna</option>
                              <option value="78253">Slatina Ilidza</option>
                              <option value="78438">Smrtici</option>
                              <option value="74279">Snjegotina Gornja</option>
                              <option value="74323">Sockovac</option>
                              <option value="71350">Sokolac</option>
                              <option value="71210">Sokolovici</option>
                              <option value="88345">Sovici</option>
                              <option value="75356">Spionica</option>
                              <option value="78420">Srbac</option>
                              <option value="75430">Srebrenica</option>
                              <option value="75350">Srebrenik</option>
                              <option value="71385">Srednje</option>
                              <option value="79249">Sreflije</option>
                              <option value="76258">Srnice</option>
                              <option value="79224">Bosanska Kostajnica</option>
                              <option value="74450">Bosanski Brod</option>
                              <option value="73110">Istocno Gorazde</option>
                              <option value="76278">Istocno Orasje</option>
                              <option value="71123">Istocno Sarajevo</option>
                              <option value="74208">Stanari</option>
                              <option value="78243">Stara Dubrava</option>
                              <option value="79268">Stari Majdan</option>
                              <option value="77224">Stijena</option>
                              <option value="73223">Stjenice</option>
                              <option value="75324">Stjepan Polje</option>
                              <option value="88360">Stolac</option>
                              <option value="72209">Stranjani</option>
                              <option value="78208">Stricici</option>
                              <option value="75305">Strpci</option>
                              <option value="88323">Studenci</option>
                              <option value="75283">Stupari</option>
                              <option value="77223">Sturlic</option>
                              <option value="75344">Suho Polje</option>
                              <option value="80249">Sujica</option>
                              <option value="79229">Svodna</option>
                              <option value="71244">Tarcin</option>
                              <option value="75414">Teocak</option>
                              <option value="74260">Tesanj</option>
                              <option value="74266">Tesanjka</option>
                              <option value="74270">Teslic</option>
                              <option value="88348">Tihaljina</option>
                              <option value="75357">Tinja</option>
                              <option value="75455">Tisca</option>
                              <option value="77233">Todorovo</option>
                              <option value="75265">Tojsici</option>
                              <option value="76272">Tolisa</option>
                              <option value="79265">Tomina</option>
                              <option value="80240">Tomislavgrad</option>
                              <option value="72213">Topcic Polje</option>
                              <option value="72270">Travnik</option>
                              <option value="88375">Trebinja</option>
                              <option value="89000">Trebinje</option>
                              <option value="78252">Trn</option>
                              <option value="76335">Trnava Donja</option>
                              <option value="76310">Trnjaci</option>
                              <option value="71220">Trnovo</option>
                              <option value="77225">Trzacka Rastela</option>
                              <option value="72283">Turbe</option>
                              <option value="75306">Turija</option>
                              <option value="78404">Turjak Kod Bosanske Gradiske</option>
                              <option value="75000">Tuzla</option>
                              <option value="76330">Ugljevik</option>
                              <option value="74278">Ugodnovici</option>
                              <option value="71233">Ulog</option>
                              <option value="74230">Usora</option>
                              <option value="73250">Ustikolina</option>
                              <option value="73265">Uvac</option>
                              <option value="73249">Vardiste</option>
                              <option value="71330">Vares</option>
                              <option value="77245">Varoska Rijeka</option>
                              <option value="74213">Velika Bukovica</option>
                              <option value="77207">Velika Gata</option>
                              <option value="77230">Velika Kladusa</option>
                              <option value="76329">Velika Obarska</option>
                              <option value="88208">Vidosi</option>
                              <option value="76275">Vidovice</option>
                              <option value="70202">Vinac</option>
                              <option value="88247">Vir Kod Posusja</option>
                              <option value="73240">Visegrad</option>
                              <option value="88307">Visici</option>
                           
                              <option value="72250">Vitez</option>
                              <option value="88326">Vitina</option>
                              <option value="74265">Vitkovci Donji</option>
                              <option value="73205">Vitkovici</option>
                              <option value="75440">Vlasenica</option>
                              <option value="71320">Vogosca</option>
                              <option value="71123">Vojkovici</option>
                              <option value="70246">Voljevac</option>
                              <option value="72227">Vozuca</option>
                              <option value="74488">Vranjak</option>
                              <option value="88113">Vrapcici</option>
                              <option value="75248">Vrazici</option>
                              <option value="78211">Vrbanja Kod Banja Luke</option>
                              <option value="78225">Vrbanjci</option>
                              <option value="78408">Vrbaska</option>
                              <option value="77231">Vrnograc</option>
                              <option value="76325">Vrsani</option>
                              <option value="77203">Vrsta</option>
                              <option value="76254">Vuckovci</option>
                              <option value="74470">Vukosavlje</option>
                              <option value="76273">Zabar Donji</option>
                              <option value="73287">Zaborak</option>
                              <option value="72220">Zabrdje</option>
                              <option value="76333">Zabrdje</option>
                              <option value="78221">Zabrdje Kod Kotor Varosi</option>
                              <option value="78214">Zaluzani</option>
                              <option value="72220">Zavidovici</option>
                              <option value="74451">Zboriste</option>
                              <option value="76259">Zelinja</option>
                              <option value="72236">Zeljezno Polje</option>
                              <option value="72000">Zenica</option>
                              <option value="72230">Zepce</option>
                              <option value="88268">Zitomislici</option>
                              <option value="75270">Zivinice</option>
                              <option value="71370">Zupca</option>
                              <option value="75400">Zvornik</option>


deploy.sh

sudo pkill -f rails
sudo pkill -f puma
sudo git checkout -- front-api/db/schema.rb
sudo git pull


cd front-api
bundle install
rvmsudo rake db:migrate
rvmsudo bundle exec puma -e production -b unix:///var/www/ribica/ribica_app.sock -d

cd ..
cd back-office
bundle install
rvmsudo RAILS_ENV=production rails s -d

cd ..
cd front-ui
sudo npm install
sudo grunt build

cd ..
sudo service nginx restart



start_elastic_search.sh

sudo /opt/elasticsearch-1.4.4/bin/./elasticsearch -Xmx512m -Xms512m -d



ribica.conf


upstream ribica_app {
        server unix:///var/www/ribica/ribica_app.sock;
}

server {
        listen 443 ssl;
        server_name ribica.ba www.ribica.ba;


        location / {
                root /var/www/ribica/front-ui/build;
                try_files $uri $uri/ /index.html;
        }

        location /backoffice {
                auth_basic "Restricted";
                auth_basic_user_file /etc/nginx/.htpasswd;
                proxy_pass http://localhost:3000;
                proxy_set_header Host $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

        location /api {
                proxy_pass http://ribica_app;
                proxy_set_header Host $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }


#listen 443;

ssl on;
ssl_certificate /etc/certifikati/SSL.crt;
ssl_certificate_key /etc/certifikati/www.ribica.ba.key;
ssl_protocols       SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers         HIGH:!aNULL:!MD5;
}




default

# You may add here your
# server {
#       ...
# }
# statements for each of your virtual hosts to this file

##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

server {
        listen 80 default_server;
        server_name ribica.ba www.ribica.ba;
        return 301 https://$server_name$request_uri;

        # Make site accessible from http://localhost/
}





default - dev server

upstream ribica_app {
        server unix:///var/www/ribica/ribica_app.sock;
}

server {
        listen 80 default_server;
        listen [::]:80 default_server;

  location / {
                root /var/www/ribica/front-ui/build;
                try_files $uri $uri/ /index.html;
        }

        location /backoffice {
                auth_basic "Restricted";
                auth_basic_user_file /etc/nginx/.htpasswd;
                proxy_pass http://localhost:3000;
                proxy_set_header Host $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

        location /api {
                proxy_pass http://ribica_app;
                proxy_set_header Host $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

}
~                                                                                                                                                                                                                                           
~             