这应该能回答以下问题:
如何在ASP.NET 2.0中配置MachineKey - Web Farm部署注意事项
Web Farm Deployment Considerations
If you deploy your application in a Web farm, you must ensure that the
configuration files on each server share the same value for
validationKey and decryptionKey, which are used for hashing and
decryption respectively. This is required because you cannot guarantee
which server will handle successive requests.
With manually generated key values, the settings should
be similar to the following example.
<machineKey
validationKey="21F090935F6E49C2C797F69BBAAD8402ABD2EE0B667A8B44EA7DD4374267A75D7
AD972A119482D15A4127461DB1DC347C1A63AE5F1CCFAACFF1B72A7F0A281B"
decryptionKey="ABAA84D7EC4BB56D75D217CECFFB9628809BDB8BF91CFCD64568A145BE59719F"
validation="SHA1"
decryption="AES"
/>
If you want to isolate your application from other applications on the
same server, place the in the Web.config file for each
application on each server in the farm. Ensure that you use separate
key values for each application, but duplicate each application's keys
across all servers in the farm.
简而言之,要设置机器密钥,请参考以下链接:
设置机器密钥 - Orchard文档。
引用:
使用IIS管理器设置机器密钥
如果您可以访问安装Orchard的服务器的IIS管理控制台,则这是最简单的设置机器密钥的方法。
启动管理控制台,然后选择网站。打开机器密钥配置:
![The IIS web site configuration panel](https://istack.dev59.com/8eBrb.webp)
机器密钥控制面板具有以下设置:
![The machine key configuration panel](https://istack.dev59.com/CHyCT.webp)
对于验证密钥和解密密钥,请取消“在运行时自动生成”。
单击面板右侧的“操作”下的“生成密钥”。
单击“应用”。
并且,如果不存在,请在所有
webservers
下的
system.web
标记中的
web.config
文件中添加以下行。
<machineKey
validationKey="21F0SAMPLEKEY9C2C797F69BBAAD8402ABD2EE0B667A8B44EA7DD4374267A75D7
AD972A119482D15A4127461DB1DC347C1A63AE5F1CCFAACFF1B72A7F0A281B"
decryptionKey="ABAASAMPLEKEY56D75D217CECFFB9628809BDB8BF91CFCD64568A145BE59719F"
validation="SHA1"
decryption="AES"
/>
请确保您拥有机器密钥和web.config
文件的永久备份