Deleting an environmental variable for IIS

老子叫甜甜 提交于 2021-02-11 16:55:57

问题


I've understood that, in order to make IIS read a new environmental variable, I have to reset it via an administrator's command:

iireset /restart

I know that one can also restart IIS from the admin panel at server level. More context to my complete web app setup in my previous question/answer: in brief it is a Python Flask app running on IIS through WSGI and FastCGI.

What is still surprising me is that now, if I delete a previously created environmental variable, IIS keep seeing it, even after restarting it, as done above.

Why is that possibly happening? And how should I delete the variable for IIS?


回答1:


If you insist that you want to go with environmental variables (notice that you also have the alternative .env file), then you need to set them via the IIS FastCGI Settings from the IIS admin at server level for your specific application (the one you enabled via wfastcgi-enable).

Edit the specific row as said above and you'll find the Environment Variables collection under the "General" group of FastCGI Properties.

Now you can add and delete any of those variables and it will take effect immediately, without the need of any IIS reboot.



来源:https://stackoverflow.com/questions/65871980/deleting-an-environmental-variable-for-iis

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!