Deployment of angular6 production environment

for projects built with angularcli 6.0.2 and nginx as proxy, the js/css file path is 404

.

clipboard.png

clipboard.png
nginx

clipboard.png

clipboard.png
--base-href ./index.htmlbase href./

clipboard.png

clipboard.png

clipboard.png
jshtml 200

clipboard.png

clipboard.png

clipboard.png

clipboard.png

clipboard.png

Mar.22,2021

what you are doing is wrong. You should not use reverse proxies. These are static resources. Why not put them directly in the nginx directory?


solved, use this command: "ng build-- base-href / ng6-ant/-- prod", where 'ng6-ant' is the ID of the agent listening on the server

location /ng6-ant {
            alias  /home/nginx_web/ng6-ant;
            index  index.html index.htm;
            try_files $uri $uri/ /index.html =404;
        }

how to prefix the address for css/js in the index.html code of build with a. / prefix

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b309c6-2bd44.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b309c6-2bd44.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?